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.

This is a followup on my previous question. I have tried to plot my data and I see the following now.current image of the plot

Would it be possible to define the size of the area that is used for the plot? I have tried to change the size with scale but that just does what it says.

Is there also a way to use smaller bars? I'm trying to get nearly vertical lines (very narrow bars) stopping at 1 in my case.

This is the part of the data file I'm trying to get working.

0.000021 1
0.000723 1
0.000835 1
0.024507 1
0.024628 1
0.027483 1
0.027548 1
0.027702 1
0.027778 1
0.027916 1
share|improve this question
1  
In general, you should always post a minimal example to show what you've tried and what doesn't work. Also, take a look at the pgfplots manual. It's really detailed, so it might seem a bit overwhelming at first, but if you skim through it once you'll have a good feeling of the capabilities and how to use them. –  Jake Jun 19 '12 at 23:26

1 Answer 1

I think in this case it's better to use a ycomb plot, which uses lines instead of bars. Your data is so closely spaced that bars would always be too wide.

You can control the size of the plot using width=<length> or height=<length. If you set only one of the two options, the plot area will be scaled proportionally, if you set both at the same time you can change the aspect ratio.

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots, pgfplotstable}

\usepackage{filecontents}
\begin{filecontents}{data.csv}
0.000021 1
0.000723 1
0.000835 1
0.024507 1
0.024628 1
0.027483 1
0.027548 1
0.027702 1
0.027778 1
0.027916 1
\end{filecontents}

\pgfplotstableread[header=false]{annotations.csv}{\annotationstable}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    ycomb, ymin=0,
    enlarge y limits=false,
    width=15cm, height=5cm
]
\addplot +[mark=none] table {data.csv};
\end{axis}
\end{tikzpicture}

\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.