Provide a "school book axes" option
Brought to you by:
cfeuersaenger,
ludewich
A plot created with pgfplots
doesn't look by default like the ones in "school books".
axis lines=center
option is helpful in this respect, but the resulting axis is missing the "0" tick.extra x ticks=0
option is helpful in this respect, but the resulting tick is not at the best place.extra x tick style
option is helpful in this respect, but the needed code is not as simple as one would expect.\documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ % axis lines=center, % extra x ticks=0, % extra x tick style={ % tick label style={ % anchor=north east, % xshift=-.5*\pgfkeysvalueof{% % /pgfplots/major tick length% % }, % } % } ] \addplot {x^2-10}; \end{axis} \end{tikzpicture} \end{document}
On the other hand, tikz
's school book axes
option is both helpfull and simple in this respect.
Hence it would be nice for pgfplots
to provide a school book axes
option as well.
Comment: As the source code and the example in the pgfmanual suggest, the dv's
school book axes
does not compensate themajor tick length
.By the way,
school book axes/standard labels
corresponds tox label style={right}
andy label style={above}
. These options should be a consequence ofaxis lines=center
.If I read correctly, the default anchor is decided by the following (
pgfplots.code.tex
line 2881)This distinguishs
right
. But does not distinguish betweenleft
andmiddle
. Hence I need extrax label style={right}
.My MWE is
PS. I did not pay attention in school. I do not have a clear idea what textbooks should look like.