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

9 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Joseph Cheng
Joseph Cheng el 31 de Mzo. de 2017
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.

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by