1

I would like to put labels on the left side of a y-axis, but the text gets cropped. How can I prevent this?

enter image description here

(Also, the entries are looking awful, so any ideas how to make it looking better are greatly appreciated. I want to recreate this: How do I generate a logarithmic x-axis without a y-axis?)

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    width=12cm,
    y=2cm,            % y unit vector
    hide y axis,        % hide the y axis
    xmode = log,        % logarithmic x axis
    axis x line*=bottom,% only show the bottom x axis line, without an arrow tip
    xmin=1e-4, xmax=1e2,% range for the x axis
    xlabel = Dose in Sv,
    every x tick/.style={black, line width=0.3pt}
]
\addplot [no markers, line width=8pt] table {
0.002 1
0.004 1
};

\node[anchor=east] at (axis cs:2e-4,1) {Hello};

\addplot [no markers, line width=8pt] table {
60 2
100 2
};

\node[anchor=east] at (axis cs:2e-4,1) {Hello};
\node[anchor=east] at (axis cs:2e-4,2) {Is it me you're looking for?};

\end{axis}
\end{tikzpicture}

\end{document}
4
  • 6
    You can add clip=false to your axis options, see tex.stackexchange.com/questions/13281/…. For making it look better: I'd probably use ymin=0, y=3ex in the axis options to make sure the bars are always spaced the same distance apart, regardless of the number of lines you have. If you specify the line widths using the same units (e.g. line width=2.5ex), you can control whether you want a small gap between the bars.
    – Jake
    Apr 19, 2013 at 8:34
  • @Jake Could you make that an answer?
    – Joseph Wright
    Aug 13, 2013 at 11:57
  • @biologue: Did that work? Or did you end up using something else (in that case, could you post an answer)?
    – Jake
    Aug 13, 2013 at 11:59
  • Frankly, I don't remember. I ended up not using this plot, sorry.
    – Eekhoorn
    Aug 13, 2013 at 12:06

0

Browse other questions tagged .