I want to change format of x or y number in green box of below graph
.
-
This is covered in the manual quite extensively. At which point are you stuck?– percusseMay 4, 2012 at 7:55
-
In what way? There are lots of ways of altering the formatting, so we need to know what you mean (font, size, decimal places, ...).– Joseph Wright ♦May 4, 2012 at 7:55
-
I want change 1o^2 to 100– sayrosMay 4, 2012 at 7:57
-
possible duplicate of pgfplots ticklabel format logarithmic scale– hpekristiansenOct 25, 2014 at 15:47
2 Answers
You can change the formatting for an axis using the every ...
system. For example
\begin{axis}
[
every x tick label/.append style =
{
/pgf/number format/.cd,
precision = 0,
fixed
}
]
should I think work here. This works by adding some basic pgf
number formatting instructions to the end of the code which is used to print the tick labels.
-
1this approach works well for non-logarithmic axes. Axes with log scale are treated with a different code, in this case, only the exponent is affected by number printing (since many people want an exponent even if it is a real number). May 4, 2012 at 19:36
-
@Christian. Hmm, in that case my answer is wrong. Would you write an answer and let me know, and I'll delete this one.– Joseph Wright ♦May 4, 2012 at 19:39
-
1oh, why - simply keep it. It is always good to have a reference for these things. May 4, 2012 at 19:40
If you intend to change the formatting of an axis with linear scale (i.e. "normal" numbers), you can proceed as in Joseph's answer, i.e. by modifying the keys with /pgf/number format/
prefix.
Log-axes however require the log ticks with fixed point
key; it reconfigures pgfplots
to produces fixed point representation for log axes:
\begin{axis}[log ticks with fixed point]
...
This style requires the most recent pgfplots stable version 1.5.1
-
See also tex.stackexchange.com/a/139084/38080 (linked for the next one searching...)– RmanoFeb 9, 2016 at 18:41