Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I created a bar graph using pgfplot and option ybar. I would get a graph wider. I used 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}

but the plot became bigger in height and width. Instead I would have only a wider graph

share|improve this question

closed as too localized by Joseph Wright Feb 2 '13 at 22:37

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
I don't remember how many times I've already asked you to make minimal working examples (MWE) showing the needed packages. –  egreg Dec 24 '12 at 16:29
    
I don't understand in this case which is the reason I have to put package...the example is not exacutable because it calls file in my hard disk. I'm asking only if it exist a option to get wider plot –  Mazzy Dec 24 '12 at 16:32
3  
People expert in plots usually have data files available. But you're not helping them in making a complete example that one can play with, without the need to guess packages. –  egreg Dec 24 '12 at 16:34
    
ok right...I will add needed packages –  Mazzy Dec 24 '12 at 16:35
2  
If you give a width option and leave the height option free, it will try to keep the aspect ratio constant. Otherwise x post scale would be suitable for you though I'm not sure if I understand your question correctly. –  percusse Dec 24 '12 at 17:03
show 2 more comments

Browse other questions tagged or ask your own question.