LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
altenbach

Correctly align markers and cursors of intensity graphs

Status: New

Currently, the markers of intensity graphs are left-aligned with the intensity pixels. This is most noticable when graphing small arrays, but is a general problem. Have a look at the left picture (x0 and dx are at the default). There is one too many markers on each axis and it is errorprone to read out the coordinates of a certain pixel because it is always betwen two adjacent markers.

 

(If we graph a 1D array with 10 elements on a plain graph with the same size (loose fit off), the axis will go from 0..9. It is misleading to show another marker at 10 in the case of the intensity graph!)

 

Correct would be to center the axis markers on the pixels as simulated in the image on the right. Now the limits are correct!

 

The problem is even more severe with cursors locked to the plot. The cursors align with the markers and thus fall right between four adjacent pixels (left) while they should be smack dab in the middle of exactly one (right). Currently, we have a 25% chance of picking the right pixel with a cursor unless we are very carefully!

 

 

Idea summary: The markers of intensity graphs need to be centered on the graph pixels. Same for cursors.

 

(...of course the same applies to intensity charts and similar)

8 Comments
Ken_Naylor
Member

This has been bugging me for years - never occured to me to post it on Ideas Exchange

X.
Trusted Enthusiast
Trusted Enthusiast

I think this is more subtle than it looks like. 

Without turning philosophical and getting out of topic, a similar issue could be raised about the XY graphs in "interpolation" display styles (what I call myself the histogram.display mode). Take the simple code below generating a dummy histogram with bin boundaries:

[0,1[, [1, 2[, ..., [9,10[

 

ScreenHunter_001.jpg

 

Displayed in the mode where the X axis reports the start of the bin (5th mode in the display style list), creating a cursor attached to the plot will give you something like this:

 

ScreenHunter_002.jpg

 

Notice how the cursor sticks to the START of the bin, whereas you could argue that a more natural location should be the center of the bin. However, the cursor location simply reflects the X coordinate of the provided data, so it is in this sense "correct".

 

If you now choose the 3rd interpolation mode, where you are supposed to provide the center of the bin, the exact same data as above will now be displayed as:

 

ScreenHunter_003.jpg

 

Now the cursor location with respect to the bin appears more "natural", however the displayed values on the X axis are incorrect if the data is supposed to be interpreted as an histogram with bin boundary [0, 1[, [1, 2[, etc...

In other words, you have to choose the display mode that corresponds to the data that you want to display, but the cursor location will not reflect any "natural" location. It will simply reflect the provided coordinates.

 

The same exact thing happens with the 2D intensity graph, with the difference that we are offered a single "interpolation" mode, if I may call it that way by analogy with the XY graph.(or 1D graphs in general).

Coming back to your idea. What you are assuming implicitly is that, in histogram language, people will always want to display 2D histogram data by providing the bin center location OR, if that is not the case,  they will always want to display the corresponding cursor at the center of the bin.

I think that this is a bit restrictive and instead I would suggest more flexibility in the following form:

 

- for 1D graphs, when interpolation (or bar graph) style is chosen, offer an option to display cursors with an offset equal to half of the bin size (or a variable offset?). Note that this is not a general solution, as you could have variable size bins, and you still would have issues with end bins, etc.

 

- for 2D graphs (intensity plots), offer different "interpolation" styles as for the 1D graphs AND provide the same cursor offset option as suggested above (there is less of a problem here, as the "bin" sizes have to be identical - which by the way suggests to offer more flexibility here as well, but that's another can of worm).

 

So in conclusion, I see where you are coming from, but I think you are missing a lot of cases where this arbitrary modification of the current behavior could wreak havoc many intended uses.

My 2 cts.

 

altenbach
Knight of NI

> Now the cursor location with respect to the bin appears more "natural", however the displayed values on the X axis are incorrect if the data is supposed to be interpreted as an histogram with bin boundary [0, 1[, [1, 2[, etc...

 

Well, we have a choice of interpolation modes and thus can pick the right one. For example if we do a histogram with DBL values coerced to the index, it will round to the nearest, thus a 0.5..1.5 boundary for index=1 is correct (3rd interpolation mode).

 

In any case this is all irrelevant, because we have pixels that map directly to array elements, The markers and cursors need to be aligned with the elements and not with the element boudaries.

X.
Trusted Enthusiast
Trusted Enthusiast

Again, it depends on how you are planning to use the intensity graph. For instance, I am using cursors to delimit regions of interests and *I* need the cursor to be locked to the corners of the "pixels". How is that for irrelevant?

I am just saying that your suggestion is proposing to switch from one arbitrary choice to another, while there might be ways of suggesting things that would admittedly be more confusing for the average user, but will render LabVIEW more powerfull, not less.

Now admittedly, this is all irrelevant indeed, as NI has not shown much enthusiasm to address shortcomings in some of their legacy controls and botched some of their potential replacements. And I am not saying this in a desponded spirit, they have their priorities.

altenbach
Knight of NI

Right, if you are selecting areas with cursors, the current behavior seems preferable. Maybe we should be given a choice.

 

However, if you compare it to e.g. waveform graphs, locked cursors always fall on the data points, so selecting an x-range with two cursors will not place the cursor halfway between two points either and nobody complained yet. 😉 (yes, we can play with the interpolation stype, of course...)

fabric
Active Participant
Aligning cursors with the centres of data points ("pixels") does not preclude the selection of regions... The normal convention is that the ROI line is "inclusive", so the pixels covered by the line are included in the selected region.
X.
Trusted Enthusiast
Trusted Enthusiast

You do realize that "pixels" in a 2D intensity graphs have to be interpreted as "bins" in the framework I was using in my first post. So they have a physical extent and are not to be confused with infinitesimally small "points". Of course I agree that for "curves" (by contrast with "histograms") you don't want to have the cursor halfway between two points. But in this case you would probably not use the "interpolation" styles.

Just in case it is not clear: I am not arguing that Altenbach's suggestion is useless, I am just saying that as is, it is trading one convention (which has its use cases) for another (which would make the former difficult to implement). I am saying: would we not want instead more flexibility?

 

Manzolli
Active Participant

In the example presented by altenbach it's clear that the proposed idea improves readability. Kudos!

André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil