Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Legend for Contour Plot
Replies: 5   Last Post: Apr 9, 2014 6:04 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1
Registered: 4/9/14
Re: Legend for Contour Plot
Posted: Apr 9, 2014 6:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Thank you Claude and Jessica, this helped me a lot!

Though for me it didn't work perfectly for filled plots (contourf), so I made som changes.

%generate plot

for n=1:length(hc)
%'CData' works better for filled plots
% for regular contour plots the same procedure as suggested earlier works fine
% levels(n)=get(hc(n),'UserData');
% remove duplicates
% sort (here in descending order)
% remove NaN values that are assigned if limits are used in the plot
% insert the legend

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.