diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex | 168 |
1 files changed, 5 insertions, 163 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex index 0e7dc2f4705..6f805573d05 100644 --- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex +++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex @@ -1617,6 +1617,8 @@ In some applications, more than one $y$ axis is used if the $x$ range is the sam \begin{codeexample}[] \begin{tikzpicture} + % let both axes use the same layers + \pgfplotsset{set layers} \begin{axis}[ scale only axis, xmin=-5,xmax=5, @@ -1640,6 +1642,7 @@ In some applications, more than one $y$ axis is used if the $x$ range is the sam \begin{enumerate} \item Scaling. You should set |scale only axis| because this forces equal dimensions for both axis, without respecting any labels. \item Same $x$ limits. You should set those limits explicitly. + \item You need to tell \PGFPlots\ that it should share the same graphics layers for both axes. In this case, \PGFPlots\ will draw plots of the first axis and of the second axis onto the same layer. It will also draw background(s) into the background layer and descriptions into the foreground layer. Use the key |\pgfplotsset{set layers}| in front of the first axis to prepare the complete picture for layered graphics. \end{enumerate} You may want to consider different legend styles. It is also possible to use only the axis, without any plots: @@ -1647,6 +1650,8 @@ It is also possible to use only the axis, without any plots: \begin{codeexample}[] % \usepackage{textcomp} \begin{tikzpicture} + % let both axes use the same layers + \pgfplotsset{set layers} \begin{axis}[ scale only axis, xmin=-5,xmax=5, @@ -2230,166 +2235,3 @@ Thus, typing |\ref|\marg{name} somewhere outside of the axis, maybe even outside \end{stylekey} \end{pgfplotskey} -\subsubsection{Scaling Descriptions: Predefined Styles} -\label{sec:scaling:styles} -It is reasonable to change font sizes, marker sizes etc. together with the overall plot size: Large plots should also have larger fonts and small plots should have small fonts and a smaller distance between ticks. - -\begin{keylist}{ - /tikz/font=\mchoice{\textbackslash normalfont,\textbackslash small,\textbackslash tiny,$\dotsc$}, - /pgfplots/max space between ticks=\marg{integer}, - /pgfplots/try min ticks=\marg{integer}, - /tikz/mark size=\marg{integer}} - These keys should be adjusted to the figure's dimensions. Use -\begin{codeexample}[code only] -\pgfplotsset{tick label style={font=\footnotesize}, - label style={font=\small}, - legend style={font=\small} -} -\end{codeexample} - to provide different fonts for different descriptions. - - The keys |max space between ticks| and |try min ticks| are described on page~\pageref{maxspacebetweenticks} and configure the approximate distance and number of successive tick labels (in |pt|). Please omit the |pt| suffix here. -\end{keylist} - -There are a couple of predefined scaling styles which set some of these options: - -\begin{stylekey}{/pgfplots/normalsize} - Re-initialises the standard scaling options of \PGFPlots. - -\begin{codeexample}[] -\begin{tikzpicture} - \begin{axis}[normalsize, - title=A ``normalsize'' figure, - xlabel=The $x$ axis, - ylabel=The $y$ axis, - minor tick num=1, - legend entries={Leg}] - \addplot {max(4*x,7*x)}; - \end{axis} -\end{tikzpicture} -\end{codeexample} - - The initial setting is -\begin{codeexample}[code only] -\pgfplotsset{ - normalsize/.style={ - /pgfplots/width=240pt, - /pgfplots/height=207pt, - /pgfplots/max space between ticks=35 - } -} -\end{codeexample} -\end{stylekey} - -\begin{stylekey}{/pgfplots/small} - Redefines several keys such that the axis is ``smaller''. - -\begin{codeexample}[] -\begin{tikzpicture} - \begin{axis}[small, - title=A ``small'' figure, - xlabel=The $x$ axis, - ylabel=The $y$ axis, - minor tick num=1, - legend entries={Leg}] - \addplot {x^2}; - \end{axis} -\end{tikzpicture} -\end{codeexample} - The initial setting is -\begin{codeexample}[code only] -\pgfplotsset{ - small/.style={ - width=6.5cm, - height=, - tick label style={font=\footnotesize}, - label style={font=\small}, - max space between ticks=25, - } -} -\end{codeexample} -Feel free to redefine the scaling -- the option may still be useful to get more ticks without typing too much. You could, for example, set |small,width=6cm|. -\end{stylekey} - -\begin{stylekey}{/pgfplots/footnotesize} - Redefines several keys such that the axis is even smaller. The tick labels will have |\footnotesize|. - -\begin{codeexample}[] -\begin{tikzpicture} - \begin{axis}[footnotesize, - title=A ``footnotesize'' figure, - xlabel=The $x$ axis, - ylabel=The $y$ axis, - minor tick num=1, - legend entries={Leg}] - \addplot+[const plot] - coordinates { - (0,0) (1,1) (3,3) (5,10) - }; - \end{axis} -\end{tikzpicture} -\end{codeexample} - The initial setting is -\begin{codeexample}[code only] -\pgfplotsset{ - footnotesize/.style={ - width=5cm, - height=, - legend style={font=\footnotesize}, - tick label style={font=\footnotesize}, - label style={font=\small}, - title style={font=\small}, - every axis title shift=0pt, - max space between ticks=15, - every mark/.append style={mark size=8}, - major tick length=0.1cm, - minor tick length=0.066cm, - }, -} -\end{codeexample} -As for |small|, it can be convenient to set |footnotesize| and set |width| afterwards. - -You will need |compat=1.3| or newer for this to work. -\end{stylekey} - -\begin{stylekey}{/pgfplots/tiny} - Redefines several keys such that the axis is very small. Most descriptions will have |\tiny| as fontsize. - -\begin{codeexample}[] -\begin{tikzpicture} - \begin{axis}[tiny, - title=A ``tiny'' figure, - xlabel=The $x$ axis, - ylabel=The $y$ axis, - minor tick num=1, - legend entries={Leg}] - \addplot+[const plot] - coordinates { - (0,0) (1,1) (3,3) (5,10) - }; - \end{axis} -\end{tikzpicture} -\end{codeexample} - The initial setting is -\begin{codeexample}[code only] -\pgfplotsset{ - tiny/.style={ - width=4cm, - height=, - legend style={font=\tiny}, - tick label style={font=\tiny}, - label style={font=\tiny}, - title style={font=\footnotesize}, - every axis title shift=0pt, - max space between ticks=12, - every mark/.append style={mark size=6}, - major tick length=0.1cm, - minor tick length=0.066cm, - every legend image post/.append style={scale=0.8}, - }, -} -\end{codeexample} -As for |small|, it can be convenient to use |tiny,width=4.5cm| to adjust the width. - -You will need |compat=1.3| or newer for this to work. -\end{stylekey} |