I have a few PGF plots in my document where the label positions need to be adjusted separately from other plots. I use the \pgfplotsset in preamble to adjust some general settings applicable to all the plots. An MWE is as follows:


    \pgfplotsset{plot coordinates/math parser=false}
    label style={anchor=near ticklabel},
    xlabel style={yshift=0.5em},
    ylabel style={yshift=-0.5em},
    tick label style={font=\scriptsize },
    label style={font=\scriptsize},
    legend style={font=\scriptsize},
    title style={font=\fontsize{7}}}


        axis lines*=left,
        ylabel absolute, ylabel style={yshift=-1em}]
        \addplot+[mark=none] plot {x^2};

        axis lines*=left]
        \addplot+[mark=none] plot {x^2};


The problem I have is that when I want to adjust the label position in a plot axis property the labels font sizes get reset to the original value and are not \scriptsize

How can I set the individual label distance while preserving the global label style like fonts, etc. ? I know I can separately adjust the font size in the axis property but I would like to use a global setting for the fonts!



1 Answer 1


As given in the manual

/pgfplots/ylabel absolute/.style={%
    /pgfplots/every axis y label/.style={at={(0,0.5)},xshift=-35pt,rotate=90},
    /pgfplots/every y tick scale label/.style={
    at={(0,1)},above right,inner sep=0pt,yshift=0.3em

is not an /.append style but overwrites the previous settings. Either you rename this style and change /.style keys to /.append style or add those settings manually.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .