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.math.mathematica

Topic: format legend?
Replies: 1   Last Post: Dec 29, 2012 3:09 PM

Advanced Search

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

Posts: 1,639
Registered: 3/14/08
Re: format legend?
Posted: Dec 29, 2012 3:09 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 12/28/12 at 5:33 AM, dario.rehman@gmail.com (dabd) wrote:

>Plot[Evaluate[{(b/(b + 1)) (n/(1 - n))} /.
>n -> Range[0.05, 0.40, 0.05]], {b, 0, 2}, PlotLegends ->
>Table[StringForm["n=``", ToString[k, InputForm, NumberMarks :>
>False]], {k, 0.05, 0.40, 0.05}]]


>How can I format the numbers in the legend with 2 decimal places?

Try NumberForm as in:

Plot[Evaluate[{(b/(b + 1)) (n/(1 - n))} /.
n -> Range[0.05, 0.40, 0.05]], {b, 0, 2},
PlotLegends ->
Table["n=" <> ToString[NumberForm[k, {3, 2}]], {k, 0.05, 0.40,
0.05}]]




Date Subject Author
12/28/12
Read format legend?
Dário Abdulrehman
12/29/12
Read Re: format legend?
Bill Rowe

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.