pgfplot
我使用和选项创建了一个条形图ybar
。我会得到一个更宽的图表。我使用了width option
\documentclass[12pt,a4paper,twoside,openright]{book}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{semilogxaxis}[ybar,
ymajorgrids=true,
xlabel=packet loss,ylabel=energia,
legend pos = north west]
\addplot [fill=red!50,draw=red!50!black]
table [x=pep,y=1]
{./MATLAB/grafici/energia/broadcast_scenario/energy_broadcast_varpktslossprobability_100nodes.txt};
\addplot [fill=blue!70, draw=blue!50!black]
table [x=pep,y=20]
{./MATLAB/grafici/energia/broadcast_scenario/energy_broadcast_varpktslossprobability_100nodes.txt};
\addplot [fill=violet!70, draw=violet!50!black]
table [x=pep,y=50]
{./MATLAB/grafici/energia/broadcast_scenario/energy_broadcast_varpktslossprobability_100nodes.txt};
\addplot [fill=orange!50, draw=orange!50!black]
table [x=pep,y=100]
{./MATLAB/grafici/energia/broadcast_scenario/energy_broadcast_varpktslossprobability_100nodes.txt};
\legend{\footnotesize{$1$},\footnotesize{$20$},\footnotesize{$50$},\footnotesize{$100$}}
\end{semilogxaxis}
\end{tikzpicture}
\end{document}
但图的高度和宽度变得更大。相反,我只会得到一个更宽的图表