|
From: Ethan A M. <sf...@us...> - 2017-08-15 21:41:45
|
On Tuesday, 15 August, 2017 12:39:23 Dima Kogan wrote: > sfeam <sf...@us...> writes: > > > 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. > > > > 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. > > "noautoscale" applies to the whole plot, does it not? It applies to only one component of the plot at a time. The idea is so you can plot x, y, and z but only scale to fit y. I.e. points from x and z may be outside the range defined by y. plot 'x' noautoscale, 'y', 'z' noautoscale > I think what would > be most appropriate here is some sort of "origcolors" option applicable > only to rgbimage/image data sources. So autoscaling would still apply, > but would ignore "origcolors" data. Does that make sense? It makes sense for input RGB PNG images, but I am not certain it generalizes. For that matter I'm not clear on what "autoscale" even means for rgbimage data. For image data it ends up controlling cbrange for the palette mapping. But for rgb images there is no palette, so what exactly is being scaled? This is not a part of the code that I know very well. Right now I don't have any opinion on it because I don't really understand what it does now or what the other options might be. Ethan |