Plot 如何使用LaTex在条形图上绘制最小值和最大值?

Plot 如何使用LaTex在条形图上绘制最小值和最大值?,plot,latex,bar-chart,Plot,Latex,Bar Chart,是否有方法将最小值和最大值绘制到平均条形图,以类似于下图中的附图 谢谢 使用pgfplots可以: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.16} \begin{document} \begin{tikzpicture} \begin{axis} \addplot+ [ ybar, error bars/.cd,

是否有方法将最小值和最大值绘制到平均条形图,以类似于下图中的附图

谢谢


使用
pgfplots
可以:

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.16}

\begin{document}

\begin{tikzpicture} 
\begin{axis}
    \addplot+ [
        ybar,
        error bars/.cd,
            y dir=both, y explicit,
    ] coordinates {
        (0,3) +- (0,1) 
        (1,2) +- (0,0.4) 
        (2,4) +- (0,1)
        (3,1) +- (0,0.6) 
        (4,2) +- (0,0.1)
    };
\end{axis}
\end{tikzpicture}

\end{document}

使用
pgfplots
可以:

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.16}

\begin{document}

\begin{tikzpicture} 
\begin{axis}
    \addplot+ [
        ybar,
        error bars/.cd,
            y dir=both, y explicit,
    ] coordinates {
        (0,3) +- (0,1) 
        (1,2) +- (0,0.4) 
        (2,4) +- (0,1)
        (3,1) +- (0,0.6) 
        (4,2) +- (0,0.1)
    };
\end{axis}
\end{tikzpicture}

\end{document}

如果从表中绘图,该怎么办?@HughPerkins如果您有新问题,请使用右上角的“提问”按钮。好的,原始问题没有说明数据不是来自表中;因此,我觉得我的问题与原来的问题事实上是一致的?但当然,好吧,如果从表中绘图,会怎么样?@HughPerkins如果你有一个新问题,请使用右上角的“提问”按钮好吧,原来的问题没有说数据不是从表中来的;所以我觉得我的问题实际上和原来的问题是一致的?但是当然,好的,可以