Dear Anthony,
what you see is the effect of the "cycle list". The cycle list allows
you to omit style options and let pgfplots choose style options for you:
each \addplot will advance the cycle list pointer.
In your case, you use \addplot+[<options>]. The '+' tells pgfplots to
"append" <options> to whatever has been found in the cycle list. The
default cycle list, in turn, uses dashed line patterns after the first
couple of plots.
The solution is simple: omit the '+'. This tells pgfplots to _not_ use
the cycle list. It will only use <options>.
Kind regards
Christian
Am 14.11.2014 18:34, schrieb Anthony Lasenby:
> Dear Dr. Feuersaenger,
>
> First of all, many thanks indeed for pgfplots - it's a wonderful
> package, and I am very pleased to have found something enabling the
> creation of such high quality plots within Latex.
>
> I have just hit a problem with a particular plot I am trying to
> create. This reads in data from several files, and plots out a line
> for each, 8 in total. All the lines should be solid, but if the first
> group of 4 lines is present, then 3 out of the 4 in the second group
> of lines come out dashed, as shown in the attached plot. If the first
> group of lines is not present, the second group all correctly come out
> as solid. I've included the code below - it won't compile without the
> data files of course, but I wondered if there was something
> immediately evident about what I was doing which would lead you to
> suggest where the problem is. Note each file consists of 200 rows of 4
> floating point numbers, and I'd be happy to send these as well if you
> had the time to look at the problem in detail.
>
> Thanks very much,
>
> Anthony Lasenby
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> \begin{figure}
> \begin{center}
> \begin{tikzpicture}
> \begin{axis}[thick,
> title={Overall title},
> xlabel={$r$},
> ylabel={$h$},width=3.5in,height=2.5in,
> xmin=0,xmax=10,ymin=0,ymax=5
> ]
> \addplot+[mark=none, smooth, red] table[x index=0,y index=1]
> {high_h_r_EE_1_L_0p8.dat};
> \addplot+[mark=none, smooth, blue] table[x index=2,y index=3]
> {high_h_r_EE_1_L_0p8.dat};
> \addplot+[mark=none, smooth, red] table[x index=0,y index=1]
> {low_h_r_EE_1_L_0p8.dat};
> \addplot+[mark=none, smooth, blue] table[x index=2,y index=3]
> {low_h_r_EE_1_L_0p8.dat};
> \addplot+[mark=none, smooth, red] table[x index=0,y index=1]
> {high_h_r_EE_1_L_0p998.dat};
> \addplot+[mark=none, smooth, blue] table[x index=2,y index=3]
> {high_h_r_EE_1_L_0p998.dat};
> \addplot+[mark=none, smooth, red] table[x index=0,y index=1]
> {low_h_r_EE_1_L_0p998.dat};
> \addplot+[mark=none, smooth, blue] table[x index=2,y index=3]
> {low_h_r_EE_1_L_0p998.dat};
> \end{axis}
> \end{tikzpicture}
> \caption{A caption}
> \label{fig:h-e-EE-1}
> \end{center}
> \end{figure}
>
>
|