3

I have a simple PGF plot using this code

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{figure*}[htpb]
\centerline{
\hbox{
\begin{tikzpicture}[scale=0.6]
\begin{axis}[enlarge x limits=false, xlabel={$s$}, ylabel={ATA}, grid=major]
\addplot+[mark=square] table[x=x,y=m1]{atak.csv};
\end{axis} \end{tikzpicture}}}
\caption{Test Figure}
\end{figure*}
\end{document}

The source is also available here and here

Based on this simple code, I have some questions:

  • There exists a lot of distance between the axis title and the axis itself. How can I reduce this space?
  • How can I make the axis titles bigger in font size?
  • How can increase the plot width without increasing it height?
3

You can adjust settings in

width=15cm,
height=7cm,
xlabel style={at={(ticklabel* cs:0.5)},xshift=0ex,yshift=0.2ex, anchor=center,font=\Large},
ylabel style={at={(ticklabel* cs:0.5)},xshift=0ex,yshift=-3ex, anchor=center,font=\Large}

Code:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{figure}[htpb]
\centering
\begin{tikzpicture}[scale=0.6]
\begin{axis}[width=15cm,height=7cm,enlarge x limits=false, xlabel={$s$}, ylabel={ATA}, grid=major,
       xlabel style={at={(ticklabel* cs:0.5)},xshift=0ex,yshift=0.2ex, anchor=center,font=\Large},
       ylabel style={at={(ticklabel* cs:0.5)},xshift=0ex,yshift=-3ex, anchor=center,font=\Large}]
\addplot+[mark=square] {rand};
\end{axis} 
\end{tikzpicture}
\caption{Test Figure}
\end{figure}
\end{document}

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.