Example script (for gnuplot Version 4.2 patchlevel 3):
set title "Velocity [km/s]"
set palette defined ( 0 "dark-violet", 1 "dark-blue", 4 "green", 6 "yellow", 8 "orange", 9 "red", 10 "dark-red")
set view map
set cbrange [11730:12040]
# good ps value for x11 terminal
splot "goodvelocities.dat" u 1:2:10:10 t "+" w p ps 1.0 pt 5 pal
set term post enh color
set output "test.ps"
# good ps value for PS
splot "goodvelocities.dat" u 1:2:10:10 t "+" w p ps 0.5 pt 5 pal
set output
This is really cumbersome and I need to find out different pointsizes
depending on the output terminal as you can see above. There is probably
a much better way, but looking through the plot styles I didn't find it.
So I'm grateful for any hints,
Peter.
This sounds to be exactly with the "with image" style was created for.
One pixel per data point, scaled to fit an arbitrary region on the plot.
You have a choice between using a palette-based pixel coloring from a
single scalar value or a full R/G/B color generated externally.
>
>Example script (for gnuplot Version 4.2 patchlevel 3):
> set title "Velocity [km/s]"
> set palette defined ( 0 "dark-violet", 1 "dark-blue", 4 "green", 6 "yellow", 8 "orange", 9 "red", 10 "dark-red")
> set view map
> set cbrange [11730:12040]
> # good ps value for x11 terminal
> splot "goodvelocities.dat" u 1:2:10:10 t "+" w p ps 1.0 pt 5 pal
> set term post enh color
> set output "test.ps"
> # good ps value for PS
> splot "goodvelocities.dat" u 1:2:10:10 t "+" w p ps 0.5 pt 5 pal
> set output
>
>This is really cumbersome and I need to find out different pointsizes
>depending on the output terminal as you can see above. There is probably
>a much better way, but looking through the plot styles I didn't find it.
>So I'm grateful for any hints,
> Peter.
--
Ethan A Merritt
Yes, thanks, that seems to work. Indeed now I remember that I tried it
some months (?) ago and had not gotten it to work. I think that's because
my data doesn't fully fill a rectangular area, so I now padded it with
dummy values.
That mode gives some cryptic error messages, so a lot of trial and error
is involved. At least I didn't understand what
GNUPLOT (plot_image): Visible pixel grid has a scan line longer than previous scan lines.
is supposed to mean...
Cheers,
Peter.
That is indeed pretty cryptic.
The error message is from a part of the code that tries to optimize image
rendering, but is known to be fragile. Hence the "EXPERIMENTAL" label attached
to image mode. But there is a non-optimized code path that should be more
robust, although less efficient.
Could you please try adding the keyword "failsafe" to the plot command?
E.g.:
plot 'foo' ... with image failsafe
If that works, then I think your problem is related to known issues.
If it doesn't work, please report what error message or output you get.
--
Ethan A Merritt
No, it want's a ';' between image and failsafe, I guess that means this is
not supported in 4.2.3. Will try to update to the CVS version one of these
days and retry.
Peter.
Now there was finally a time where me trying and CVS being accessible
coincided and I compiled the CVS version. ;-)
In the meantime I'm trying to plot slightly different data and haven't gotten
the above message any more. Now I instead get
GNUPLOT (plot_image): Number of pixels cannot be factored into integers
matching grid. N = 7 K = 2
Yes, I guess it's not easy to see from this
plot [0.5:10.5][0.5:10.5] "-" w image
9 1 1755.42
9 2 1688.34
1 3 698.37
3 5 173.087
4 5 1583.47
4 6 1491.55
6 6 1565.41
EOF
that this is a 10x10 grid with lots of missing pixels. Failsafe of course
doesn't help there.
I also sometimes get rhomboids instead of rectangular elements, as in
http://temp.weilbacher.org/test_image2.gp (without failsafe)
http://temp.weilbacher.org/test_image2.png
http://temp.weilbacher.org/test_image3.gp (with failsafe)
http://temp.weilbacher.org/test_image3.png
I guess I can do what I want with rgbimage and transparency but then I have
to make the palette/color computation outside gnuplot.
Peter.
> I guess I can do what I want with rgbimage and transparency but then I have
> to make the palette/color computation outside gnuplot.
Hah! The other (better) option is to redefine the palette to include
a background color as the very lowest point that is like transparent to
the output medium (like white for something I want to plot to PS and print).
And set the invalid data points to something below the cbrange, instead of
the usual 1/0 or INDEF.
The rainbox-like palette that I was using is
set palette defined ( 0 "dark-violet", 1 "dark-blue", 4 "green",
6 "yellow", 8 "orange", 9 "red", 10 "dark-red")
but now I have set it to
set palette defined ( 0 "white", 0.00001 "dark-violet", 1 "dark-blue",
4 "green", 6 "yellow", 8 "orange", 9 "red", 10 "dark-red")
That still leaves a small bar of white on the edge of the displayed
colorbar but I think I can live with that. :-)
Cheers,
Peter.