Jump to content

"real Time" Line Graph with repeating values


Recommended Posts

I am trying to create a Line Graph in labview that will plot with duplicate X values.

Basically, my data looks like

X Y

0 1

1 2

2 3

2 3

1 1

0 0

The Waveform Graph will display the Y axis correctly, so the user gets the shape, but the X axis is just in numerical order, so it is meaningless (in this case). If you use the XY graph, the line turns back on itself.

I have tried the Xscale marker values property node, but it did not display correctly.

http://picasaweb.goo...feat=directlink

Link to comment

I'm not sure what you mean by "duplicate X values", but if you don't want the line to go "back", just sort the data by the X array before putting it into the graph.

I cant sort it, as it would not make sense in the context of the test.

Basically it is a load test, with the X axis being the pressure and the Y axis being the deflection. So you want to see how it defelcted as the load increased, and then when it decresed, as it happened. If you sort it, you cannot tell what happened.

post-3394-125139546811_thumb.png

point load 300 lb.txt

Edited by dblk22vball
Link to comment

Sequence=time.

Basically, you have a problem, because you want the X scale to represent both time (sequence) and pressure. It doesn't make sense to me. How would you expect such a graph to look?

You could do it as a bar graph or an intensity graph or something like that, but you need to know how you want it to look. Now I also understand better your comment about the scale marker labels. If I understand correctly, you want X to be time and Y to be deflection, but you want to show a pressure for each data point.

Link to comment

So you basically want the X scale to have a label (the pressure) for each point. I believe this isn't supported, but I think some of the VIs in the graphics palette allow you to build this kind of graph. I think there's an example either in the example finder or somewhere in the NI forums. Alternatively, you can try displaying some annotations on the graph. You can give them whatever text you want and use code to place them where you want.

Link to comment
  • 2 years later...
  • 3 weeks later...

You need to use the XY plot.

You'll need to sort your data according to whatever you declare your X axis to be

This VI will allow you to take an XY plot and order it by X points Order XY Points.vi

This is an example of it in action on the XY Graph:Mouse Down event

Create XY Plot.vi

<!-- copy and paste. Modify height and width if desired. --> <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/f2f65ae2-3013-4a8d-b30b-f046dbc98a45/2012-01-12_1530.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/f2f65ae2-3013-4a8d-b30b-f046dbc98a45/2012-01-12_1530.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/f2f65ae2-3013-4a8d-b30b-f046dbc98a45/2012-01-12_1530.png" width="848" height="379" border="0" /></a>

Good Luck,

~,~

The Captain was here

<!-- copy and paste. Modify height and width if desired. -->

<object id="scPlayer" width="796" height="746" type="application/x-shockwave-flash" data="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e1f666fc-d269-4a1c-8cb7-5f6a9301740d/jingh264player.swf" >

<param name="movie" value="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e1f666fc-d269-4a1c-8cb7-5f6a9301740d/jingh264player.swf" />

<param name="quality" value="high" />

<param name="bgcolor" value="#FFFFFF" />

<param name="flashVars" value="thumb=http://content.screencast.com/users/NJKirchner/folders/Jing/media/e1f666fc-d269-4a1c-8cb7-5f6a9301740d/FirstFrame.jpg&containerwidth=796&containerheight=746&content=http://content.screencast.com/users/NJKirchner/folders/Jing/media/e1f666fc-d269-4a1c-8cb7-5f6a9301740d/2012-01-12_1532.mp4&blurover=false" />

<param name="allowFullScreen" value="true" />

<param name="scale" value="showall" />

<param name="allowScriptAccess" value="always" />

<param name="base" value="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e1f666fc-d269-4a1c-8cb7-5f6a9301740d/" />

<iframe type="text/html" frameborder="0" scrolling="no" style="overflow:hidden;" src="http://www.screencast.com/users/NJKirchner/folders/Jing/media/e1f666fc-d269-4a1c-8cb7-5f6a9301740d/embed" height="746" width="796" ></iframe>

</object>

Something like this?

I know it doesn't look like your plot in excel, but your plot in excel is EXTREMELY misleading.

In any Cartesian plot, an axis in 1 direction is Always increasing or Decreasing.

Your plot in excel has the X axis be completely randomly ordered

It almost sounds like you want 2 plots on the same graph, showing both Instr 1 and Force collectively vs sequence #

But in either case you have an answer to both scenario

<!-- copy and paste. Modify height and width if desired. --> <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/970befbf-eaa8-4109-a5f0-08c6e4bb87b7/2012-01-12_1544.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/970befbf-eaa8-4109-a5f0-08c6e4bb87b7/2012-01-12_1544.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/970befbf-eaa8-4109-a5f0-08c6e4bb87b7/2012-01-12_1544.png" width="1049" height="670" border="0" /></a>

Best,

Norm

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