|
From: Thomas S. <t.s...@fz...> - 2007-07-13 10:18:06
|
try 'with linespoints' instead of 'with points', you will observe a funny
behaviour:
the lines in the keys are in the right color, the points are not.
the error is in 'graph3d.c':
with 'pm3d' the color of points and lines is taken from a color range,
depending
on the z-value of your data points (that's why some of your key points are
(nearly) black).
in 'key_sample_line_pm3d' this is the normal behaviour unless you specify a
rgb-color,
that's what you've done when defining your linestyles,
then the normal 'key_sample_line' is taken:
/* If plot uses a constant color, set it here and then let simpler
routine take over */
if (plot->lp_properties.use_palette &&
plot->lp_properties.pm3d_color.type == TC_RGB) {
apply_pm3dcolor(&(plot->lp_properties.pm3d_color), term);
key_sample_line(xl,yl);
return;
}
that's why the lines in the keys are right for 'linespoints'.
but in 'key_sample_point_pm3d' this distinction isn't done, so the points
are in a color
taken from a color range.
what you need to do is to patch 'key_sample_point_pm3d' with the following:
------------------------------------------ snip
-----------------------------------------
--- graph3d.c.orig 2007-03-14 16:58:16.000000000 +0100
+++ graph3d.c 2007-07-13 12:13:09.028182248 +0200
@@ -3171,6 +3171,12 @@
if (steps < 2) steps = 2;
step = ((double)(key_sample_right - key_sample_left)) / steps;
+ /* If plot uses a constant color, set it here and then let simpler
routine take over */
+ if (plot->lp_properties.use_palette &&
plot->lp_properties.pm3d_color.type == TC_RGB) {
+ key_sample_point(xl,yl,pointtype);
+ return;
+ }
+
/* color gradient only over the cb-values of the surface, if smaller
than the
* cb-axis range (the latter are gray values [0:1]) */
get_surface_cbminmax(plot, &cbmin, &cbmax);
------------------------------------------ snip
-----------------------------------------
Alan Bromborsky wrote:
>
> Using gnuplot 4.2. I am plotting points with splot and distinguishing
> different sets of points by color alone. When I use 'set key' the
> colors of the keys displayed does not match the colors of the points
> plotted. I have attached the data file (powerflux.dat) and the gnuplot
> script file (powerflux.dat.plt). Is there anyway to get the colors of
> the keys to match the colors of the plotted points?
>
> set terminal x11 2
> set title "Spherical Power Flux"
> set xlabel "Azimuth"
> set ylabel "Elevation"
> set zlabel "Relative\nPower\nFlux"
> set xtics 60
> set mxtics 6
> set ytics 30
> set mytics 3
> set ticslevel 0
> set style line 1 lt rgb "red" lw 0 pt 1 ps 1
> set style line 2 lt rgb "green" lw 0 pt 1 ps 1
> set style line 3 lt rgb "yellow" lw 0 pt 1 ps 1
> set style line 4 lt rgb "blue" lw 0 pt 1 ps 1
> set style line 5 lt rgb "orange" lw 0 pt 1 ps 1
> set style line 6 lt rgb "light-green" lw 0 pt 1 ps 1
> splot [0:360][-90:90] "powerflux.dat" every :::0::0 using 1:2:3 with
> points linestyle 1 t "gen 2", \
> "powerflux.dat" every :::1::1 using 1:2:3 with points linestyle 2 t "gen
> 6", \
> "powerflux.dat" every :::2::2 using 1:2:3 with points linestyle 3 t "gen
> 7", \
> "powerflux.dat" every :::3::3 using 1:2:3 with points linestyle 4 t "gen
> 8", \
> "powerflux.dat" every :::4::4 using 1:2:3 with points linestyle 5 t "gen
> 10", \
> "powerflux.dat" every :::6::6 using 1:2:3 with points linestyle 6 t "gen
> 11"
> pause -1
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://www.nabble.com/gnuplot-key-colors-tf4061680.html#a11576648
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|