How can I show the% values ​​on the y axis of the graph?

In any or Mathematica graph, how can I show the% values ​​on the y axis?

I may have the following data:

data = {{{2010, 8, 3}, 0.}, {{2010, 8, 31}, -0.052208}, {{2010, 9, 30}, 0.008221}, {{2010, 10, 29}, 0.133203}, {{2010, 11, 30}, 0.044557}, {{2010, 12, 31}, 0.164891}, {{2011, 1, 31}, 0.055141}, {{2011, 2, 28}, 0.114801}, {{2011, 3, 31}, 0.170501}, {{2011, 4, 29}, 0.347566}, {{2011, 5, 31}, 0.461358}, {{2011, 6, 30}, 0.244649}, {{2011, 7, 29}, 0.41939}, {{2011, 8, 31}, 0.589874}, {{2011, 9, 30}, 0.444151}, {{2011, 10, 31}, 0.549095}, {{2011, 11, 30}, 0.539669}}; DateListPlot@data 

I just want the y axis to be in the range of 0% to 60% instead of 0.0 to 0.6.

+7
source share
4 answers

Use FrameTicks -> {{left, right},{bottom, up}}

 DateListPlot[data, FrameTicks -> {{{{0.0, "0%"}, {0.1, "10%"}, {0.2, "20%"}, {0.3, "30%"}, {0.4, "40%"}, {0.5, "50%"}, {0.6, "60%"}}, None}, {Automatic, None}}] 

enter image description here

A table for FrameTicks can be generated, for example,

 Table[{k/10., ToString@ (10 k) <> "%"}, {k, 6}] (* Out[10] := {{0.1, "10%"}, {0.2, "20%"}, {0.3, "30%"}, {0.4, "40%"}, {0.5, "50%"}, {0.6, "60%"}} *) 

If you need to make a lot of numbers, LevelScheme is a free package that makes it easy to create good sections in Mathematica, especially when it comes to grades.

EDIT: As suggested by Jagra, there is a function here that makes a list of tick specifications based on a dataset and with desired tick steps. The assumption is that the data structure is always the same.

 ticks[step_, data_] := {{Table[{k, ToString@IntegerPart @(100 k) <> "%"}, {k, Floor[ Min@data [[All, 2]], step], Ceiling[ Max@data [[All, 2]], step], step}], None}, {Automatic, None}}; 

Now you can define the plotting function

 plot = DateListPlot[#, FrameTicks -> ticks[.1, #]] & 

and use it like this: plot@data

Finally, since any Mathematica graph indicates your question, remember that FrameTicks only works on frame graphs, for other graphs use Ticks -> {{x ticks},{y ticks}} .

+8
source

You can try fiddling with FrameTicks :

enter image description here

+6
source

Assuming your y axis values ​​are given as ratios and you want them to be in percent, the simplest solution is:

 DateListPlot[{#1, 100 #2} & @@@ data] 

enter image description here

+5
source

I do not see the parameters of the graphics, such an opportunity, but you can create an intermediate function that converts your number to the right. You will see a graph of this function. This can be done easily. Good luck

-one
source

All Articles