12

I have some problems with the width of the lines in my graph. When I try to change the width of the plot lines, straight lines remain in the default width whereas the non-straight lines are shown in the desired with. How can I change the width of the straigh line? Besides that, I want to know how to change the width of the axis lines (both x and y).

\documentclass[a4paper,12pt]{report}
\usepackage{pgfplots,pgf} %graphics
\pgfplotsset{compat=1.3}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[
        xmin=0,
        xmax = 4,
        ymin = 0,
        ymax = 50,
        axis x line = bottom,
        axis y line = left,
        xlabel= \footnotesize $x$,
        ylabel style={at={(current axis.north west)},rotate=-90,xshift=-1ex,yshift=-1ex},
        ylabel= \footnotesize $f(x)$,
        xtick=\empty,
        ytick=\empty
        ]
        \addplot[mark=none,domain=0:4,very thin]{30};
        \addplot[blue,mark=none,domain=0.2:3.8,very thick]{exp(x)+3};
    \end{axis}
    \end{tikzpicture}

\end{document}
  • 2
    It works fine for me, but you need to zoom in a lot to see the difference between very thin and thin (the latter is the default line width). Try setting the straight line to ultra thick to verify that it's working. To change the axis line style, use axis line style = ultra thick. – Jake Apr 24 '13 at 7:49
  • 2
    Welcome to TeX.SE. – Peter Grill Apr 24 '13 at 7:52
  • Note the thickness example noted above has gone. – rhody Sep 21 '15 at 17:50
10

It works fine for me, but you need to zoom in a lot to see the difference between very thin and thin (the latter is the default line width). Try setting the straight line to ultra thick to verify that it's working. To change the axis line style, use axis line style = ultra thick.

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.