08-14-2023 04:38 AM - edited 08-14-2023 04:44 AM
Hey,
I am a bit afraid this is a yes or no question...
Is it possible to scale the colorbar (Edit: I meant to resize the whole FP element) of a intensity graph during runtime? As far as I can see the "Z Scale.Bounds" property is the one holding width and height but it is read-only. And other than the main plot area the colorbar does not have a "Size" property.
Reason why I ask: In my program the window holding the graph must be scalable and the graph is set to "Scale Object with pane". But the colorbar does not scale with the main plot area, so I thought I could rescale it programmatically via a property.... 🤔?
THX
Solved! Go to Solution.
08-14-2023 04:46 AM - edited 08-14-2023 04:54 AM
Hi itchy,
@itchy00 wrote:
I am a bit afraid this is a yes or no question...
And the answer is "No!"…
A similar question came up last week (to show the colorbar horizontally instead of vertical) and the answer was along the lines of "create an additional 2DPictureDisplay to show a color scale created from the ZScale values". That additional indicator would follow your "scale object with pane" settings easily…
08-14-2023 04:50 AM
Oh I am sorry I didn't find this in my keyword search... 😑
But thanks for making this quick 😉
Yeah I was thinking about the same thing, creating a second Fake-Colorbar-Plot showing just the grayscale gradient. I'll try to implement that way
08-15-2023 09:40 PM
I did some deep digging. Couldn't find anything.
08-16-2023 10:05 AM - edited 08-16-2023 10:06 AM
@GerdW wrote:
A similar question came up last week (to show the colorbar horizontally instead of vertical) and the answer was along the lines of "create an additional 2DPictureDisplay to show a color scale created from the ZScale values". That additional indicator would follow your "scale object with pane" settings easily…
or use a 1d array of color box indicators instead of a 2d picture control
08-22-2023 02:02 AM
So finally I did it that way with the 2D Picture Display.
To be honest, all these solutions are a bit shady. It's alright if you JUST display the colorbar. But once you want axis markers and labels with it, it gets really annoying.
First tried to use a simple Intensity Graph hiding everything but the y-axis (swapped to the right side) but that has some downfalls as well - for example an automatic rescaling of the plot area when axis marker values switch between 2 to 3 digits 🙄
So my solution is now the 2DPictureDisplay and I build my axis markers and label from StringIndicators with transparent background and I arrange them programmatically relative to the 2DPictureDisplay everytime the window rescales.
A bit sad that at this point you're almost at the GUI scripting level that you find in other programming environments (Visual C++, PyQT, ...) having to place the objects via coding... feels like the advantage of LabView is gone somehow at that point 🤷🏼♂
Thanks anyway for all the comments!!!