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: Ploting with legend
Replies: 1   Last Post: Apr 3, 2013 11:39 PM

Advanced Search

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

Posts: 28
Registered: 6/3/11
Re: Ploting with legend
Posted: Apr 3, 2013 11:39 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"M@lik Ali" wrote in message <kjiqlb$n48$1@newscl01ah.mathworks.com>...
> Hi all,
>
> I want to plot some data , through following code i can plot but i don't know how to put the legend at the bottom of the right corner
>
> MBA = [0.52 0.68 0.75 0.805 0.86 0.88 0.9 0.91 0.935];
> BDA = [0.53 0.695 0.705 0.715 0.725 0.751 0.77 0.78 0.79];
> plot(BDA, 'DisplayName', 'BDA', 'YDataSource', 'BDA'); hold all;
> plot(MBA, 'DisplayName', 'MBA', 'YDataSource', 'MBA');
>
> please help me how i can put the legend at the right bottom of the graph. also please tel me how to use the different symbols in the graph line.



Hello Malik,

Try this,

% Legend bottom right corner
MBA = [0.52 0.68 0.75 0.805 0.86 0.88 0.9 0.91 0.935];
BDA = [0.53 0.695 0.705 0.715 0.725 0.751 0.77 0.78 0.79];
plot(BDA, 'DisplayName', 'BDA', 'YDataSource', 'BDA'); hold all;
plot(MBA, 'DisplayName', 'MBA', 'YDataSource', 'MBA');
% Legend bottom right corner
legend('MBA','BDA',4)
% Plot Different symbols
% Example: you can use any symbols in inside the plot
text(4,0.71,'\leftarrow MBA',...
'HorizontalAlignment','left')

text(5,0.85,'\leftarrow BDA',...
'HorizontalAlignment','left')


Thanks & Regards,
Saravanan Mani



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

[Privacy Policy] [Terms of Use]

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