Jump to content

Multiple plots to referenced XY Graph


Recommended Posts

Plotting multiple plots to a single XY Graph is easy enough when the XY Graph is in the same VI -- thanks to the Multi Plot example that comes with LabVIEW. Specifically, create a 1-D array of clusters of a 1-D array of (x,y) points/clusters. This can connect directly to an actual XY Graph.

But all I have is a reference to an XY Graph. When I select the "Value" property, it won't accept multiple plots. It will only accept a single plot.

What property(ies) should I be using to plot multiple plots on an XY graph?

Link to comment

Could you please make an example of your datatype (1D-array of clusters of a 1D-array of (x,y) points/clusters)? :wacko:

Greetings Markus

ZITAT(Michael Malak @ May 23 2009, 02:12 AM)

Plotting multiple plots to a single XY Graph is easy enough when the XY Graph is in the same VI -- thanks to the Multi Plot example that comes with LabVIEW. Specifically, create a 1-D array of clusters of a 1-D array of (x,y) points/clusters. This can connect directly to an actual XY Graph.

But all I have is a reference to an XY Graph. When I select the "Value" property, it won't accept multiple plots. It will only accept a single plot.

What property(ies) should I be using to plot multiple plots on an XY graph?

Link to comment

QUOTE (Michael Malak @ May 22 2009, 08:12 PM)

Plotting multiple plots to a single XY Graph is easy enough when the XY Graph is in the same VI -- thanks to the Multi Plot example that comes with LabVIEW. Specifically, create a 1-D array of clusters of a 1-D array of (x,y) points/clusters. This can connect directly to an actual XY Graph.

But all I have is a reference to an XY Graph. When I select the "Value" property, it won't accept multiple plots. It will only accept a single plot.

What property(ies) should I be using to plot multiple plots on an XY graph?

The XY Graph is polymorphic. If you wire a different datatype in a VI, it's gonna change datatype to adapt. But if you use a reference, the datatype needs to be matched to the one in the VI where you got your reference from. Be careful with this because once you've created your reference and used it elsewhere in your program, you have a lot of broken arrows or error pop-ups (if value is a variant) if you ever change the datatype of your graph...

Link to comment

QUOTE (normandinf @ May 23 2009, 01:52 PM)

The XY Graph is polymorphic. If you wire a different datatype in a VI, it's gonna change datatype to adapt. But if you use a reference, the datatype needs to be matched to the one in the VI where you got your reference from. Be careful with this because once you've created your reference and used it elsewhere in your program, you have a lot of broken arrows or error pop-ups (if value is a variant) if you ever change the datatype of your graph...

The XY graph reference dilemma has been annoying me as well for a while. I would love to have a general reference to a XY graph so that i dynamically can control what is shown in the graph. Does anyone have a good workaround? Is there a way of up- and down-casting the type so that i can take a more general XY graph reference as input to my sub-vi (or more specifically store the general reference in a parent class)?

Link to comment

QUOTE (normandinf @ May 23 2009, 06:52 AM)

The XY Graph is polymorphic. If you wire a different datatype in a VI, it's gonna change datatype to adapt. But if you use a reference, the datatype needs to be matched to the one in the VI where you got your reference from. Be careful with this because once you've created your reference and used it elsewhere in your program, you have a lot of broken arrows or error pop-ups (if value is a variant) if you ever change the datatype of your graph...

That was it!

I deleted my XY Graph, placed a new one, and wired in the data generation from the LabVIEW example code for multiple plots. Then I created a new reference from that and deleted the data generation code.

Thanks for the help.

Link to comment

QUOTE (Michael Malak @ May 26 2009, 02:07 PM)

That sounds very familiar to one of the Known Issues.

[Don't] Try this (it will crash LabVIEW):

1. Create an XY Graph and wire it to a cluster of X and Y arrays.

2. Create a reference and wire to a property node.

3. Wire an array of clusters to the XY Graph.

post-11233-1243407618.png?width=400

The only way I know of to fix it is to delete the reference and recreate it, just as you did.

Also, when using arrays of XY Graph(s), if you don't want to lose the configuration of your graph every time the array changes, use arrays of NaN instead of changing the size of the array.

ShaunR, can you be more specific about the "Many To One" queue example, maybe a link?

Link to comment
  • 9 years later...

Join the conversation

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

Guest
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.