Jump to content

XY Graphs and Discontinuous Axes


mje

Recommended Posts

Something that has always stumped me in LabVIEW is displaying discontinuous ranges in XY Graphs. Is there a way to do this?

post-11742-0-69805600-1294264897_thumb.p

For example, the top plot shows a single graph with two plots. Displaying them as-is results in a whole bunch of empty space. Not only is it ugly, it makes the graph next to useless because you can't see any fine detail in each range. Now for the bottom graph I cheated a little and actually made two graphs, placing them next to one another. This works fine if you can know at design time how many graphs you'll need (which I don't).

The other way I've handled this is by normalizing, scaling and offsetting each range such that they do display continuously, then hiding the axis from the user so they don't see the transformed coordinates. However this time I sort of need the axis in the original coordinate space to appear. Is this even possible using the stock XY Graphs?

Link to comment

The obvious answer is to use 2 graphs, but to use that answer you'd have to know what kind of signal you are expecting and where the discontinuity should occur.

I love LabVIEW's built in graph functions, for zooming and moving around so for alot of users I'd just expect them to zoom in on the parts of the graph they care about. Of course if this data is coming in, in real time this doesn't seem like a good option. I understand that they need to be able to take a look quickly and understand the information.

Link to comment

The obvious answer is to use 2 graphs, but to use that answer you'd have to know what kind of signal you are expecting and where the discontinuity should occur.

I would have said the obvious answer is to use 2 different X axes, then set the ranges so the data appears where you want it.

Link to comment

Yes, but the caveat is I won't always need 2 ranges. It can be 1, 2, 5, or 3, for three is the holy number...

Well in reality, it can be 4 as well. And maybe occasionally 6. Well you get the idea.

I would have said the obvious answer is to use 2 different X axes, then set the ranges so the data appears where you want it.

Can you do this? And still have the axes show on the plots such that the ranges are editable?

Link to comment

Can you do this? And still have the axes show on the plots such that the ranges are editable?

Yes (I've only done it with Y axes, but I assume it's the same for X). Right-click on the X scale and choose Duplicate Scale. It's not particularly pretty, and a bit hard to tell which axis is which (for two, you can move one to the top of the graph to separate them), but it should work. In the graph properties you can set which X and Y scale will be used by each plot, and there must be a way to set that through property nodes as well. Each axis will always take up the full width of the graph, so you won't get exactly the effect you want, but it will be close.

Link to comment

Seems like it would be easier to use several graphs, hide all the Y axes except for the first, and use user events to keep the plots on the same Y scale. If you were insane, and had nothing better to do for the rest of the month, you could make it into a sweet XControl.

Depending on how many traces you need to display, you can hide some of the graphs and recompute the others' widths to fill the plot area.

Edited by jdunham
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.