Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Line Style Color per Index Question

10 views
Skip to first unread message

Richard Bair

unread,
May 3, 2012, 12:55:12 PM5/3/12
to
I'm struggling to set the color of 4x plotted lines with the following data
file and plt file. It seems only my first style called in the plot command
will be used for all 4x lines. Please advise.

Thanks!

dat file:
# Jan SF Test (12A then 12B)
2/1/2012 0
5/1/2012 28

2/1/2012 0
5/1/2012 2

# Feb SF Test (12A then 12B)
3/1/2012 0
5/1/2012 20

3/1/2012 0
5/1/2012 4

load plt file:
# inits
clear
unset colorbox
unset multiplot
unset key
set termoption dashed
set autoscale xy
set grid
set origin 0,0

# # y-axis
set yrange[0:30]

# x-axis
set timefmt "%m/%d/%Y"
set xdata time
set xrange["1/1/2012":"6/1/2012"]
set nomxtics
#set xtics format "%b-%y"
#set xtics "1/1/2012", 1209600, "5/1/2012"

# chart
set title "12A vs. 12B Linear Projections"
set style line 1 lt rgb "red" lw 1
set style line 2 lt rgb "blue" lw 1

# plot
plot'/home/rich/Documents/rich/code/gnuplot/gnu_chart.dat' using 1:2 index
0
with linespoints ls 1, \
'/home/rich/Documents/rich/code/gnuplot/gnu_chart.dat' using 1:2 index
1
with linespoints ls 2, \
'/home/rich/Documents/rich/code/gnuplot/gnu_chart.dat' using 1:2 index
2
with linespoints ls 1, \
'/home/rich/Documents/rich/code/gnuplot/gnu_chart.dat' using 1:2 index
3
with linespoints ls 2

Richard Bair

unread,
May 4, 2012, 7:54:19 AM5/4/12
to
Got it. For index to work properly, it appears that there must be 2x empty
lines between the datasets in the same *.dat file.
0 new messages