Sat 06 Aug 2016 07:31:31 AM UTC, comment #6:
OK, here's a new version of the patch, after having had some discussion on color mapping:
https://savannah.gnu.org/bugs/?48666
I did significant rework of the way scaling is done. The code currently has gnuplot cbrange as [clim(1):clim(2)], but that actually makes things more difficult. Instead, I set up the cbrange to [1:cmap_sz] which means that the linear mapping is pretty much as defined in terms of index value.
So, this new patch should fix the special logical-value images, and it should also make the examples at the above link consistent with Qt toolkit. Try the examples below.
(file #38124)
|
Sun 31 Jul 2016 11:06:57 PM UTC, comment #3:
OK, I agree this is a bug, and I know where to fix the problem. However, making the change seems to break a few other demos in the image() and imshow() scripts for the gnuplot toolkit.
Let's first agree on the meaning of the properties related to color and mapping. For this little red/green color map example, I see:
The above makes sense, in that the data is supposed to placed directly into the clim range. A 0 corresponds to clim(1), i.e., 0 or red. A 1 corresponds to clim(2), i.e., 1 or green.
However, if I look at demo 1 for image(), I'm seeing
So, why should that work? Well, this is a case of another property having an influence on matters, the "climmode". If "climmode" has a value "auto", then apparently a scaling is do be done as well. So, regardless of what I said about the first example, the clim shouldn't have a bearing on the result.
The subtlety here lies in where the responsibility for determining "clim" should be. If the "climmode" is auto, shouldn't something be setting the "clim" automatically? In the jet-map example, shouldn't "clim" be showing
if it automatically adapts? (Or does one think the toolkit should just be computing the [1 21] on its own?)
Here's where this question is important. If the current axes has the "climmode" auto, and then there are multiple items, it should adapt to that whole range of cdata. Consider slightly altering the example by placing two images side by side and one of the images has color values in a different range. (Use, graphics toolkit 'qt' if you like):
I'm seeing an image on the left which is the typical jet pattern, but on the right is an all-red pattern, i.e., the highest value of the color map. Shouldn't the jet pattern be more distributed about both images?
I'm trying different clim/mode settings for 'qt', and nothing changes:
So, I'm thinking there are multiple bugs here:
1) The gnuplot bug, which I can fix.
2) A 'qt' bug in which climmode of 'manual' appears to have no effect.
3) A more general climmode 'auto' bug in which the clim scaling doesn't appear to take in cdata values for all objects on the axes. I suppose the toolkits can address this as well, but it seems better for the more general graphics code to determine this and update "clim" appropriately.
Thoughts?
|