3

So I imported data from two txt files. However, I would like to plot the mean of the data and then the standard deviation bars. How can this be done?

\documentclass[tikz, convert = false]{standalone}
\usepackage{pgfplots}%                                                            
\pgfplotsset{compat = 1.8}%                                                       
\begin{document}
\pgfplotstableread{FRETData.txt}
\datatable%                                                                       
\pgfplotstableread{FRETData2.txt}
\datatabletwo%                                                                    
\begin{tikzpicture}
  \begin{axis}[ymin = 0.16,
    ymax = 0.22,
    minor y tick num = 5,
    xmin = -6.7,
    xmax = -6.2
    ]
    \addplot table[y = 1] from \datatable;
    \addplot table[y = 1] from \datatabletwo;
  \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

From the picture, we see that pgfplots has connected two separate experiments. How can I remove the line? Can pgfplots calculate the mean for each experiment and put standard deviation bars?

Edit 1:

So to remove the lines, I added only marks option.

dustin
  • 18,617
  • 23
  • 99
  • 204
  • 4
    My guess is that you should be using box plots instead. – juliohm Nov 16 '13 at 19:29
  • 1
    You may want to take a look at the statistics library shipped with pgfplots. I features boxplots. – Christian Feuersänger Nov 18 '13 at 19:30
  • @dustin, did the tip with the boxplots help you or do you need further assistance? In the first case I would close the question as being solved. – Stefan Pinnow Nov 02 '16 at 13:10
  • @StefanPinnow I don't remember this post is almost 3 years old. – dustin Nov 02 '16 at 15:11
  • Would you mind testing (again) and let us know? Or do you agree that we close the question as "unclear what you are asking"? – Stefan Pinnow Nov 02 '16 at 22:20
  • @StefanPinnow you don't close a question because it doesn't have an answer. Someone can always solve the problem later. If you want to you, you can answer it. – dustin Nov 03 '16 at 13:22
  • Of course I will not/cannot close the question, but I can vote to close it. I think you will agree that when somebody is asking a question and there are comments which might give a hint to the solution it is worth a try for OP to test it. Especially when there are (in sum) 5 upvotes to the comments. – Stefan Pinnow Nov 03 '16 at 13:50

0 Answers0