Jump to content
Sign in to follow this  
c2r

XY Graph

Recommended Posts

Hi guys,

I'm trying to display two plots within one xy graph. I got that to work. But I want both plots to have different Y Axis scale (ex. plot 1 with a 5db scale and plot 2 with a 10db scale). I know that i can do this by displaying each plot with its own xy graph, but that's not what i want. I want both to be in the same xy graph and have different scale. Please help.

Another problem that i have. Is it possible to put a marker at a point in a xy graph? if yes, how? thanks.

Share this post


Link to post
Share on other sites
Hi guys,

I'm trying to display two plots within one xy graph. I got that to work. But I want both plots to have different Y Axis scale (ex. plot 1 with a 5db scale and plot 2 with a 10db scale). I know that i can do this by displaying each plot with its own xy graph, but that's not what i want. I want both to be in the same xy graph and have different scale. Please help.

Another problem that i have. Is it possible to put a marker at a point in a xy graph? if yes, how? thanks.

Once the XY graph is on the front panel, right click on the Y-axis and select "duplicate scale". Then you can right click again and swap the scale to the other side of the graph. You'll also need to identify which plot associates with which scale. You can do this through the properties dialog of the graph. Go to the "Plots" tab and select the plot to modify, then choose the appropriate Y-scale to use.

I think this will get you started. There are still many cosmetic aspects you can adjust.

For the pointer, you could use a cursor. Right click the graph and make visible the "Cursor Legend".

You can move the cursor around during run-time or programmatically control the cursor through a property node of the graph. Using the cursors can be a challenge but it can create some decent user interfaces.

Hope this points you in a good direction,

James

Share this post


Link to post
Share on other sites
Hi guys,

I'm trying to display two plots within one xy graph. I got that to work. But I want both plots to have different Y Axis scale (ex. plot 1 with a 5db scale and plot 2 with a 10db scale). I know that i can do this by displaying each plot with its own xy graph, but that's not what i want. I want both to be in the same xy graph and have different scale. Please help.

Another problem that i have. Is it possible to put a marker at a point in a xy graph? if yes, how? thanks.

Check out the attached vi (in 7.1).

I used a random number generator which is kind of stupid looking, in terms of results plotted to a log scale.

The marker points are the same data plotted to the different y scales. Plot 0 (scale by facor of 10) is set to one scale and Plot 1 Scaled by a factor of 100) to the other.

I got the info on how to make the 2nd y axis from the help system. I used the graph properties to adjust the scales and the other business like showing dots and increasing the line size.

There is a scaling parameter in the properties that will help you adjust 5dB 10DdB however you desire.

The tricky part is getting the data into the form that the XY graph likes. The thing to remember that with XY you are plotting ordered pairs and the graph has to have the right format of incoming data to see what pairs are ordered.

2 corresponding arrays are bundled to make a plot. The plots are arrayed to make a multiplot. The markers are single ordered pair plots.

The context help will remind you if you bring your cursor over the XY graph icon.

MikeDownload File:post-48-1156943525.vi

Share this post


Link to post
Share on other sites

Ok, it is almost done. I got everything working except when assigning different plot to different y-axis scale in the property of the graph. It wouldnt let me. When I assign the duplitcated scale to plot 2, it changed back to original scale automatically. Somehow it wouldn't let me assign the duplicate scale to different plot. Please help again. Thanks and I appreciate both of your help. :worship:

Share this post


Link to post
Share on other sites
Somehow it wouldn't let me assign the duplicate scale to different plot. Please help again. Thanks and I appreciate both of your help. :worship:

I think you need to have all the plots wired up first then you can assign the scales to them. At least I encountered a similar sounding situation when I made the example - when I had only Plot 0 and Plot 1, I could not assigned y axes to Plot 2 and Plot 3 until I had them all bundled up and demonstrably plottable.

It would be helpful if you posted code to look at. You can be sure that if you have vaild data for plotting that you can assign different axis scales.

Mike

Share this post


Link to post
Share on other sites

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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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