How I remove edge lines and add reference lines into contour plot generated with plot(array,'style','contour')?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponse acceptée
Joseph Cheng
le 31 Mar 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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Biomedical Imaging dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!