Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: format legend?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129289] Re: format legend?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Sat, 29 Dec 2012 15:11:26 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

On 12/28/12 at 5:33 AM, dario.rehman at 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}]]




  • Prev by Date: Re: Problem with Expand and Modulus in Mathematica 9?
  • Next by Date: Re: PlotLegends package obsolete?
  • Previous by thread: Re: format legend?
  • Next by thread: Syntax Coloring Issue