I'd like to draw in the same frame a given number of box plots with the macro \psBoxplot
from the pst-plot
package. I'm retrieving the sampled data from as many files as different box plots by using the macro \readdata
. I'd like to use a single file to store the data sets for the different box plots, though.
By using the optional arguments of the \listplot
macro I can plot a given number of curves based on different data sets stored in the same file-- the latter data sets only need to comprise different columns in the file. Now, how could I do something similar to this in order to draw box plots?
I believe no MWE is needed for this question, but if required I could provide one.
MWE (as per suggestion):
Let us say I have two data sets that I'm going to number and label by the corresponding numerals; e.g., '1' and '2'. I've stored data set 'i' in the file Data<i>.dat (i=1,2) and I can draw the box plots as follows:
\documentclass{article}
\usepackage{filecontents,pstricks,pst-plot}
\begin{filecontents*}{Data1.dat}
[98 20 79 14 23 21 58 13 19 53 41 11 83 71 10 89 10 46 76]
\end{filecontents*}
\begin{filecontents*}{Data2.dat}
[98 20 79 14 23 21 58 13 19 53 41 11 83 71 10 89 10 46 76]
\end{filecontents*}
\begin{document}
% Let us say my data are bounded between 10 and 100.
\psset{xunit=20mm,yunit=0.5mm}
\begin{pspicture}(0,0)(3,110)
\multido{\ind=1+1}{2}{%
% Reading data from file
\readdata{\Data}{Data\ind.dat}
\rput{0}(\ind,0){\psBoxplot[barwidth=0.5\psxunit]{\Data}}
}
\end{pspicture}
\end{document}
With the MWE I generate the two data files Data1.dat and Data2.dat (right, they store the same data, but that's irrelevant here).
If I were to plot two curves (as opposed to box plots) in the same frame I could do it with \listplot
, have the data sets stored in the same file comprising each data set one column, and use the options plotNo
and plotNoMax
. I'd like to be able to do something like this with box plots.