How can I insert specific number of contour values into a filled color contour plot (not for all contour lines)
1 view (last 30 days)
Show older comments
Hi all,
I am creating a filled color contour plot of my data. Here is the code;
x=data(:,1); y=data(:,2); z=data(:,3);
xx=linspace(-1.20,1.5,100) ;yy=linspace(-1.5,1.5,100);
[XX YY]=meshgrid(xx,yy); ZZ=griddata(x,y,z,XX,YY); fig1=figure('Color',[1 1 1]); axes1=axes('Parent',fig1,'FontSize',14); [C,h]=contourf(XX,YY,ZZ,20,'k-','linewidth',1); clabel(C,h,'LabelSpacing',250,'Color','k','Fontsize',8);hold on
When I plot this, I obtain the isolines with labels. But since too much labels on the figure, it seems too complicated. Hence, I do not want to add all the labels in the figure, but specific labels. I have tried some commands such as defining a vector than reading it with "clabel" in the form of "clabel(c,h,v)", but it does not work. Furthermore, I've used set(h,'TextList',[-0.1 -0.2 -0.3], but haven't been successful. Do you know how I can insert the labels that I want?
Also, is it possible to change contouring algorithm?
I would really appreciate if you could help me regarding my questions.
Kind regards,
Kaan
0 Comments
Answers (0)
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!