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

9 次查看(过去 30 天)
Hi
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.
Thanks

采纳的回答

Joseph Cheng
Joseph Cheng 2017-3-31
you would do something like
clf
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by