|
From: sfeam <sf...@us...> - 2017-08-15 16:17:06
|
On Monday, 14 August 2017 21:13:00 Dima Kogan wrote:
> Hi. These days a common plotting use case for me is to draw an image
> from a file, with some data plotted on top of it. I do something like
> this:
>
> plot "xxx.png" binary filetype=auto flipy with rgbimage, "yyy" with points palette, ...
>
> This works OK. There's an annoyance however: the points in "yyy" have a
> 3rd column, rendered as a color, and I want gnuplot to autoscale these
> colors. But the pixels in "xxx.png" also have colors and gnuplot
> interprets these colors as data too, and these 0-255 color values are
> included in the autoscaling along with the 3rd column in "yyy". So for
> instance, if the 3rd column in "yyy" is in [0-1], then the image is
> plotted normally, but the "yyy" points all look black. Conversely, if
> the points in "yyy" are in [10000-20000], then the points all look
> yellow and the image is all black.
>
> Is there a way to instruct gnuplot to just plot the image as is, without
> trying to interpret the pixel colors as data? If not, can we add such an
> option? The current behavior is definitely good for some use cases, but
> not for all of them.
gnuplot> stats 'yyy' using 3 prefix "COLOR"
gnuplot> plot 'xxx.png' binary filetype=auto with rgbimage, \
'yyy' using 1:2:($3 * 255./COLOR_max) with points
This is not ideal since the color axis is still labeled [0:255]
Right now the program ignores the "noautoscale" keyword for image plots.
I'm not sure what would happen if that were to change.
If you experiment with the code, that's where I suggest starting.
Ethan
|