Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12985 > unrolled thread

Re: format legend?

Started byBill Rowe <readnews@sbcglobal.net>
First post2012-12-29 20:09 +0000
Last post2012-12-29 20:09 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: format legend? Bill Rowe <readnews@sbcglobal.net> - 2012-12-29 20:09 +0000

#12985 — Re: format legend?

FromBill Rowe <readnews@sbcglobal.net>
Date2012-12-29 20:09 +0000
SubjectRe: format legend?
Message-ID<kbnikt$1c6$1@smc.vnet.net>
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}]]

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web