1
$\begingroup$

Is NumberForm not good with the following use of ListPlot? Look at my example:

 vectorj = {Rationalize[0.3],NumberForm[1.2131, 2]};
 ListPlot[vectorj]

This is not working. Is 1.21 not recognized as a number because of NumberForm which just prints out? Could anybody tell me how to output an approximate value of 1.2131 as 1.21 and then use it in ListPlot correctly?

$\endgroup$
0

1 Answer 1

2
$\begingroup$

In contrast to the numbers, such as 1.21 with the head Real, the NumberForm is not. Let us try with the heads

    1.2131 // Head
NumberForm[1.2131, 2] // Head

(*  Real

  NumberForm  *)

This is the reason.

$\endgroup$
1
  • $\begingroup$ may N work rather than NumberForm? $\endgroup$
    – Andrea G
    Commented Apr 28, 2017 at 12:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.