2
votes

enter image description hereI am using gnuplot 4.4 patchlevel 4 on Mac OS X v10.6.8. I'm running a gnuplot script, a simplified version of which is this: (file1, file2,...etc are specified in the terminal before running the script)

reset
set term aqua enhanced font "Times-Roman, 18"
set term aqua dashed
plot file1 u 3:10 w lines lt 1 linecolor rgb "#FF0000",\
     file2 u 3:10 w lines lt 1 linecolor rgb "#00FF00",\
     file3 u 3:10 w lines lt 1 linecolor rgb "#0000FF",\
     file4 u 3:10 w lines lt 1 linecolor rgb "#FF00FF",\
     file5 u 3:10 w lines lt 1 linecolor rgb "#00FFFF",\
     file6 u 3:10 w lines lt 2 linecolor rgb "#FF0000",\
     file7 u 3:10 w lines lt 2 linecolor rgb "#00FF00",\
     file8 u 3:10 w lines lt 2 linecolor rgb "#0000FF",\
     file9 u 3:10 w lines lt 2 linecolor rgb "#FF00FF",\
     file10 u 3:10 w lines lt 2 linecolor rgb "#00FFFF"

files 1-5 are one data set and files 6-10 are another. I would like files 1 through 5 to be plotted with solid lines and files 6 through 10 to be plotted with dashed lines. Is there any way to do this in aqua terminal? According to the built-in help, "lines can be drawn either solid or dashed". I've looked at multiple faqs and docs but the consensus seems to be that it is really difficult or impossible to do? Additionally, does anyone know of any comprehensive documentation on the aqua terminal or on gnuplot commands in general?

Edit: To plot files 6-10 I have been using lw 6 to distinguish them from the 1-5 since I couldn't get dashed lines to work. Would the script above as I have it do this correctly? In other words, is the script doing what I think it is doing? (plotting 1-5 solid lines and 6-8 thicker lines?) I ask because in an attempt to make dashed lines, I replace "lw 6" with "lt 2". This however results in file5 being plotted with dashed lines which is just weird.

Edit 2: I attached my terminal test graphic and there doesn't seem to be any mention of dashed lines?

Edit 3: Updated script to reflect changes made.

Edit 4: Graphic is now of set term aqua enhanced font "Times-Roman, 18" dashed; test

enter image description here

1
in response to your edit, the linetype of the plots is probably getting incremented in gnuplot internally. If you want file5 to be plotted with lt 1 then you should put that in there, otherwise gnuplot just guesses. - mgilson
@mgilson -- (Edited above) Ok cool, it's plotting correctly now, but all lines are solid still. - whatsherface
did you do set term aqua enhanced font "Times-Roman, 18" dashed (note the dashed at the end). What is the output of show terminal? - mgilson
can you post the graphic of set term aqua enhanced font "Times-Roman, 18" dashed; test? - mgilson
@mgilson -- Oh, there the dashed lines are! - whatsherface

1 Answers

0
votes

It's not too bad at all actually (at least for me on OS-X 10.5.8 with gnuplot 4.2. I stopped building aquaterm in my newer versions of gnuplot as I don't like that terminal) In the aqua terminal, linetype 1 is solid and linetype 2 is dashed.

set term aqua enhanced font "Times-Roman, 18" dashed
plot sin(x) w lines lt 1 lc rgb "blue", cos(x) w lines lt 2 lc rgb "purple"

To see the linetypes that your version of gnuplot will use for a particular terminal, you can use the test command after setting the terminal (and output if the terminal needs it).

A suggestion for how your code should look:

reset
set term aqua enhanced font "Times-Roman, 18" dashed
plot file1 u 3:10 w lines lt 1 linecolor rgb "#FF0000",\
     file2 u 3:10 w lines lt 1 linecolor rgb "#00FF00",\
     file3 u 3:10 w lines lt 1 linecolor rgb "#0000FF",\
     file4 u 3:10 w lines lt 1 linecolor rgb "#FF00FF",\
     file5 u 3:10 w lines lt 1 linecolor rgb "#00FFFF",\
     file6 u 3:10 w lines lt 2 linecolor rgb "#FF0000",\
     file7 u 3:10 w lines lt 2 linecolor rgb "#00FF00",\
     file8 u 3:10 w lines lt 2 linecolor rgb "#0000FF",\
     file9 u 3:10 w lines lt 2 linecolor rgb "#FF00FF",\
     file10 u 3:10 w lines lt 2 linecolor rgb "#00FFFF"

EDIT

I just looked on a friend's computer. for her (gnuplot 4.4.4, os-X 10.6?) linetype 8 was the first dashed linetype (highlighting the usefulness of the test command).