【问题标题】:Tikzpicture: enlarge cuts off the other side of the plotTikzpicture:放大切断情节的另一边
【发布时间】:2016-05-25 00:40:39
【问题描述】:

我想在条形图中的条形上方放置一些文本标签。为了给他们腾出空间,我尝试使用enlarge limits,但看起来它改变了我的整个情节,切断了底部。我该如何解决这个问题?

我附上了代码、原始情节和 enlarge y limits 行未注释的情节。

\begin{tikzpicture}
\begin{axis}[
    xlabel = {loss},
    ylabel = {probability},
    enlarge x limits=0.2,
    %enlarge y limits={rel=0.2,upper},
    bar width = 16pt,
    width=14cm,
    height=8cm,
    xtick=data]
    \addplot[ybar,fill=white] coordinates {(-10,0.9) (0,0.095) (95,0.005)};
    \node[above] at (axis cs:-10,0.9) {$90\%$};
    \node[above] at (axis cs:0,0.095) {$9.5\%$};
    \node[above] at (axis cs:95,0.005) {$0.5\%$};
\end{axis}
\end{tikzpicture}
\end{figure}

【问题讨论】:

    标签: plot latex bar-chart tikz


    【解决方案1】:

    好的,我刚刚发现我可以使用 ymax 获得想要的效果:ymax=1.1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-27
      • 1970-01-01
      • 2015-01-18
      相关资源
      最近更新 更多