I would like to put labels on the left side of a y-axis, but the text gets cropped. How can I prevent this?
(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}
clip=false
to youraxis
options, see tex.stackexchange.com/questions/13281/…. For making it look better: I'd probably useymin=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.