I would like to plot the following image using TikZ:

enter image description here

How do I generate an X-axis with logarithmic scaling using TikZ? For linear scaling I use this code:

\draw (3,0) -- coordinate (x axis mid) (21,0);

    \foreach \x in {3,...,21}
        \draw (\x,0pt) -- (\x,-3pt)
        node[anchor=north] {\x};

\node[below=0.8cm] at (x axis mid) {Physical dose [Gy]};
  • Maybe it could be faster to use pgfplots Feb 18, 2013 at 9:14
  • Yes, but I don't know how to remove the y-axis in pgfplots.
    – Eekhoorn
    Feb 18, 2013 at 9:14

2 Answers 2


This looks like a job for PGFPlots:

    y=1.5cm,            % 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
\addplot [no markers, line width=6pt] table {
0.002 1
0.004 1

  • You may also skip the repeaded 1's and use an y expr=1 insted.
    – student
    Dec 18, 2016 at 20:27

It is not supposed to be the correct way to go. Feel free to edit!

enter image description here

\def\f[#1,#2]{!#1 log 4 add #2 8 div}
            ticksize=-1.5pt 1.5pt,

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .