Tikzpicture - 标题旁边/下方的箭头

时间:2014-11-20 22:53:17

标签: plot label latex tikz

我正在寻找Latex的帮助。我是新来的,所以不幸的是我还不允许发布图片。

我有一个标记轴(x和y)的tikzpicture图。现在我想在x轴下方添加一个箭头来指示后续处理的方向。另外我想在y轴标签的左边有一个箭头指向上方。这个箭头应该有第二个标签,上面写着" Fe" 的相对增加。

\begin{figure}[htbp]
\centering
\begin{tikzpicture}[scale=1]
\begin{axis}[
    %legend style={at={(1.05,0.05)}, %gibt Ort für Legende an
    %anchor=south west},
    %axis x line=bottom,    % erzeugt x-Achse mit Pfeil
    %axis y line=left,  %
    width=15.5cm,
    height=10cm,
    %scaled ticks=false,
    %ymin=0,
    xmin=-0.5,
    xmax=5,
    ymin=0,
    ymax=5,
    xtick={0,1,2,3,4},
    xticklabels={Fe2O3,1,2,3,4},
    bar width=50pt,
    %ytick={},
    %yticklabels={},
                %use un%%ts,
                %x unit=-,
                %x unit prefix=,
                %y unit=\frac{m}{s},
                %y unit prefix=,
        xlabel=Subsequential Treatments over Time ,
    ylabel=Auger Peak to Peak Height Ratio Fe:O,
            x tick label style= {rotate=90,anchor=east},
            ybar stacked]



    \addplot [draw=white, very thin]
            coordinates {(0,1) (1,1) (2,3) (3,2) (4,1.5)}; 
            \addplot [draw= blue, fill=blue]
            coordinates {(0,1) (1,1) (2,3) (3,2) (4,1.5)}; 


            %\node at (100,1) [orange!50!yellow]{\small{ZnO-h}};


\end{axis}
\end{tikzpicture}

\caption[Auger Spectrum of HOPG]{Auger Peak to Peak Height Ratios of Fe:O at an primary electron beam   of \unit{2.0}{keV}.}
 \label{Auger_ratio_histogram_}
\end{figure}

1 个答案:

答案 0 :(得分:0)

下面的代码说明了放置此类箭头的两种技术。两者的出发点是将name=MyAxis添加到axis选项,这样您就可以像使用普通axis一样引用node的定位点。 pgfplots axis也有outer north east等锚点,位于轴描述之外,而north east位于轴的角落。

enter image description here

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    name=MyAxis,
    %legend style={at={(1.05,0.05)}, %gibt Ort für Legende an
    %anchor=south west},
    %axis x line=bottom,    % erzeugt x-Achse mit Pfeil
    %axis y line=left,  %
    width=15.5cm,
    height=10cm,
    %scaled ticks=false,
    %ymin=0,
    xmin=-0.5,
    xmax=5,
    ymin=0,
    ymax=5,
    xtick={0,1,2,3,4},
    xticklabels={Fe2O3,1,2,3,4},
    bar width=50pt,
    %ytick={},
    %yticklabels={},
                %use un%%ts,
                %x unit=-,
                %x unit prefix=,
                %y unit=\frac{m}{s},
                %y unit prefix=,
        xlabel=Subsequential Treatments over Time ,
    ylabel=Auger Peak to Peak Height Ratio Fe:O,
            x tick label style= {rotate=90,anchor=east},
            ybar stacked]



    \addplot [draw=white, very thin]
            coordinates {(0,1) (1,1) (2,3) (3,2) (4,1.5)}; 
            \addplot [draw= blue, fill=blue]
            coordinates {(0,1) (1,1) (2,3) (3,2) (4,1.5)}; 


            %\node at (100,1) [orange!50!yellow]{\small{ZnO-h}};


\end{axis}
\draw [-latex] ([yshift=-2ex]MyAxis.outer south west) --node[below]{Direction of subsequential treatments} ([yshift=-2ex]MyAxis.outer south east);
\draw [-latex] (MyAxis.outer south west) ++(-2ex,0) coordinate(start) --node[sloped,above] {relative increase in Fe} (start |- MyAxis.outer north west);
\end{tikzpicture}
\end{document}