Quantcast
Channel: pgfplotsset append style is not appended to tikzpicture axis environment - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by Jake for pgfplotsset append style is not appended to tikzpicture axis environment

$
0
0

You can use the execute at begin axis key to sneak another \pgfplotsset command into the axis options. This \pgfplotsset command will be executed after the other axis options have been set:

\documentclass[12pt,a4paper,tikz]{standalone} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage{tikz,pgfplots,grffile,amsmath} \pgfplotsset{compat=newest} \pgfplotsset{    mytikzstyle/.style={        every axis/.append style={            execute at begin axis={                \pgfplotsset{                    legend style={                        font=\tiny                    },                    every x tick label/.append style={font=\scriptsize},                    every y tick label/.append style={font=\scriptsize}                }            }        }    } } \pgfplotsset{mytikzstyle} \pgfplotsset{/pgfplots/width=8cm} \pgfplotsset{/pgfplots/height=6cm} \begin{document} \begin{tikzpicture} \begin{axis}[% separate axis lines, every x tick label/.append style={font=\color{black}}, legend style={at={(0.99,0.01)}, anchor=south east, legend cell align=left, align=left, draw=gray}, ] \addplot [line width=0.8pt, color=black]   table[row sep=crcr]{% 1  1\\ 100    100\\ }; \addlegendentry{Hello $U_{1}\frac{xyz}{xyz}$} \end{axis} \end{tikzpicture}% \end{document}

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>