f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Minor scalar bar improvements

Open snoyer opened this issue 7 months ago • 3 comments

When the colormap is discretized it would be nice if the labels lined up with the boundaries of the colors. This can be achieve by setting ScalarBarActor->SetNumberOfLabels(n + 1); when the number of colors n "is small" (how small is "small" remains to be determined, there may be a way to make it work for large numbers too but I haven't looked into it). See following image for comparison:

  • before: Image
  • after: Image

Also scalar bar related, but independent of the previous point, VTK's widget is drawn with 64 colors by default which may make it look like the colormap is discretized (visible steps on the bar) even when it's not. The number of drawn steps could be raised (arbitrarily? dynamically according to render resolution?), for example using scalarBar->SetMaximumNumberOfColors(512);:

  • before: Image
  • after: Image

snoyer avatar May 27 '25 08:05 snoyer

arbitrarily

Yeah, that sounds fine to me.

mwestphal avatar May 27 '25 08:05 mwestphal

hi, it's dsniel from discord, i'd like to be assigned to this issue :]

rrhxde avatar Jun 08 '25 20:06 rrhxde

Sure !

mwestphal avatar Jun 08 '25 21:06 mwestphal

VTK's widget is drawn with 64 colors by default which may make it look like the colormap is discretized (visible steps on the bar) even when it's not.

Fixed by #2321

mwestphal avatar Jul 25 '25 12:07 mwestphal

Hi @rrhxde , do you want to tackle the remaining part of the issue ?

mwestphal avatar Aug 20 '25 08:08 mwestphal

I’m not able to right now, could I be unassigned?

rrhxde avatar Aug 21 '25 09:08 rrhxde

Of course!

mwestphal avatar Aug 22 '25 08:08 mwestphal