Colormapping multiple images #12354
Replies: 2 comments 1 reply
-
The first case is clearly broken (considers one index and is order dependent). The right behavior can be obtained with adding: img = p.image(image=...)
mapper.domain = [(img, "image")] The problem is that with implicit domain, the data is used to establish "metrics", which is the first (and only) index that's computed. Here's where this happens: To fix this, the implicit case should be removed and |
Beta Was this translation helpful? Give feedback.
-
As this is a bug, I have created issue #12355 for it. |
Beta Was this translation helpful? Give feedback.
-
Figure.image()
can take multiple images (multiple 2D arrays) that are colormapped using the sameColorMapper
. This can give rise to some strange results. Consider this example which has one array with values in the range 0 to 1, and a second with values in the range 1 to 2.This produces
Here each array is separately colormapped so they both use the full palette and are rendered with the same colors. The colorbar shows the mapping used for the second image so the limits are approximately 1 to 2. If you swap the order of the 2 arrays then the output is the same except that the colorbar limits are approximately 0 to 1.
I can get what I consider to be the correct output using e.g.
which produces
which essentially forces the colormapper to ignore the actual data values. This wouldn't work for
EqHistColorMapper
as it always needs to scan the data.This isn't really a problem caused by
Figure.image
taking multiple arrays, you can obtain the same result using twoFigure.image
calls that take different arrays but the same colormapper. But then at least you can specify different colormappers for eachFigure.image
call whereas the singleFigure.image
call with multiple arrays is obliged to use a single colormapper.ContinuousColorMapper
has adomain
property that I think is relevant here, but if I replace the singlep.image
call above withthen I still see the same result.
I am not sure if this is a bug or a documentation issue, or user error, or whatever, hence I have created it as a discussion.
Beta Was this translation helpful? Give feedback.
All reactions