Open pgf-tikz-bot opened 7 years ago
Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/70/#cdaa Author: symbol-1 Timestamp: 2017-06-18 15:40:22.637000
Comment: As the source code and the example in the pgfmanual suggest, the dv's school book axes
does not compensate the major tick length
.
By the way, school book axes/standard labels
corresponds to x label style={right}
and y label style={above}
. These options should be a consequence of axis lines=center
.
If I read correctly, the default anchor is decided by the following (pgfplots.code.tex
line 2881)
\ifnum\pgfplots@yaxislinesnum=3 % if 'axis y line==right' then
\pgfkeysalso{/pgfplots/every axis x label/.style={
/pgfplots/near ticklabel align=inside,at={(ticklabel* cs:0)},anchor=near ticklabel opposite}}%
\else
\pgfkeysalso{/pgfplots/every axis x label/.style={
/pgfplots/near ticklabel align=inside,at={(ticklabel* cs:1)},anchor=near ticklabel opposite}}%
\fi
This distinguishs right
. But does not distinguish between left
and middle
. Hence I need extra x label style={right}
.
My MWE is
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=center,
xlabel={$x$},x label style={right},
ylabel={$f(x)$},y label style={above},
extra x ticks=0,
extra x tick style={
tick label style={
anchor=north east,
%xshift=-.5*\pgfkeysvalueof{ % A philosophical question:
% /pgfplots/major tick length % Do we really need to
%}, % compensate this length?
}
}
]
\addplot {x^2-10};
\end{axis}
\end{tikzpicture}
\end{document}
PS. I did not pay attention in school. I do not have a clear idea what textbooks should look like.
Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/70/ Author: denisbitouze Timestamp: 2017-03-25 08:12:06.129000
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.On the other hand,
tikz
'sschool book axes
option is both helpfull and simple in this respect.Hence it would be nice for
pgfplots
to provide aschool book axes
option as well.