|
From: Jim K. <jek...@kl...> - 2009-09-29 05:06:08
|
Jim Kleckner wrote: > What would be the recommended way to plot line segments with varying > color (a multicolored single line plot)? > > The 4.2 documentation says that "rgbcolor variable" "is only available > in 3D plotting mode (splot)". > > The 4.3 documentation doesn't mention this restriction. > > Can 4.3 take the color of line segments from a column of data? > > Is there any way to do this simply (or not) in 4.2.5? > > Thanks! I got around to compiling the CVS/4.3 version of Gnuplot and line segments do work with color. However the demo script below works for png files but gives the following error for pdf files: fatal exception: [2100] PDF_lineto: Function must not be called in 'page' scope Anyone run into this or suggest where to start? I'm running: gnuplot from cvs sources as of today. PDF-Lib-Lite-7.0.4p4 (updated to freshest to test this) CYGWIN_NT-5.1 kleckner2 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin Thanks! PS, I'm still curious if someone knows of a way to plot 2D line segments with color even in 4.2 gnuplot. ============= greenblackred.dem ============= # # colorspec demo for line segments # # greenblackred.dat: # 1 0 65280 # 2 1 0 # 3 0 16711680 # 4 1 0 # 5 0 65280 # 6 1 0 # 7 0 16711680 # 8 1 0 # 9 0 65280 # set terminal png set output "greenblackred.png" reset set xrange [ 0 : 10 ] #plot 'greenblackred.dat' using 1:2 with lines title "simple sawtooth" plot 'greenblackred.dat' using 1:2:3 with lines lc rgb variable title "variable sawtooth" set terminal pdf set output "greenblackred.pdf" plot 'greenblackred.dat' using 1:2 with lines title "simple sawtooth" plot 'greenblackred.dat' using 1:2:3 with lines lc rgb variable title "variable sawtooth" |