How I remove edge lines and add reference lines into contour plot generated with plot(array​,'style','​contour')?

8 views (last 30 days)
Deo on 31 Mar 2017
Commented: Deo on 1 Apr 2017
My matlab version is 2016b. I have three 861*1 double arrays; X, Y, Z I attached the .mat file for these variable. With the codes below, I generated attached contour plot. (I deeleted the attached matlab file and the image files due this question was solved.)
plot_data = fit ([X, Y], Z, 'cubicinterp');
contourplot = plot(plot_data,'style','contour');
1. How I remove black edge lines? -> I solved this issue with "set (plotname, 'edgecolor', 'none')"
2. I want to add two reference lines having Z values of 'min(Z)+1.00' and 'min(Z)+4.00'.
Below is image what I want to make. I made this one with OriginPro2016 but I need to make it with Matlab.

Accepted Answer

Joseph Cheng
Joseph Cheng on 31 Mar 2017
you would do something like
load variables
plot_data = fit ([X, Y], Z, 'cubicinterp');
contourplot = plot(plot_data,'style','contour');
set (contourplot, 'edgecolor', 'none')
x= linspace(min(X),max(X));
y= linspace(min(Y),max(Y));
[xx yy]=meshgrid(x,y);
zz = plot_data(xx,yy);
hold on
contourplotline = contour3(xx,yy,zz,[8.754 11.75],'LineWidth',2,'color','k');
then use the text() function to insert the text values where you want. or color the lines differently and put it as a legend.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!