0

I copied the code in the accepted answer in How can I adjust the position of xlabel and ylabel with pgfplots?, and I added a title={title with very long lines}. Is there a way to move the title above the ylabel? I wish to keep the position of the axis labels. I tried searching "pgfplots title position", but I got info for axis titles instead of the title for the whole graph.

\documentclass{standalone}

\usepackage{ pgfplots, amsmath }

\usepackage[T1]{fontenc} \usepackage{lmodern}

\begin{document} \begin{tikzpicture} \begin{axis}[ xmin=-2, minor tick num=2, axis y line=middle, axis x line=middle, xlabel=$x$,ylabel=$\sin x$, every axis x label/.style={ at={(ticklabel* cs:1.05)}, anchor=west, }, every axis y label/.style={ at={(ticklabel* cs:1.05)}, anchor=south, }, title={title with very long lines} ] \addplot[blue,mark=none] plot[domain=-5:5,samples=40] (\x,{sin(\x r)}); \end{axis} \end{tikzpicture} \end{document}

ylabel and title overlapped

0 Answers0