2014-11-20 177 views
3

我正在尋找與乳膠的幫助。我是新來的,所以很遺憾我不允許發佈圖片。乳膠 - tikzpicture - 箭頭旁邊/陰謀標籤

我有一個帶有標記座標軸(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} 

如果有人能幫助我,這將是非常棒的。謝謝。

+0

作爲參考,對未來LaTeX的任何問題都更適合於http://tex.stackexchange.com/ – 2015-07-31 07:08:17

回答

0

下面的代碼說明了放置這種箭頭的兩種技術。兩者的出發點都是將name=MyAxis添加到axis選項,該選項允許您像axis的定位點那樣引用node。 A pgfplotsaxis也具有諸如outer 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}