LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plot graph using array

How to plot the a graph with 2 1D array? Something like that as below and output as jpg
Message 1 of 14
(30,662 Views)

Drop an  XY graph on your FP, and go to the BD. Hover the mouse over the XY-graph terminal and the context help will show you which data-types can be connected to the XY-graph.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 14
(30,658 Views)
hmm. i think i ask wrongly. how to set my X axis to start from my 1st array value?
0 Kudos
Message 3 of 14
(30,647 Views)
How do i convert this display to a jpg?
0 Kudos
Message 4 of 14
(30,642 Views)

Hi ander99,

 

Just to clarify, your graph only starts plotting from your first array value. The only reason it does not look like it starts at the left edge of the graph is because the scale starts before the first point. If you want your graph's X scale to start at the beginning of the data (and end at the end of the data) then right click your graph and make sure that Loose Fit under X Scale is unchecked. Also, you might want to consider checking AutoScale X under X Scale as well.

 

To export your image, you can also right click the graph and choose Export Simplified Image... Alternatively, if you want to export inside the program, you can simply right click the graph, and select Create » Invoke Node » Export Image. This will create an invoke node on your block diagram. Wire it up accordingly and it will export your image for you programmatically.

 

Hope this helps.

Best regards,
Vern Yew
Applications Engineer
0 Kudos
Message 5 of 14
(30,604 Views)
Thank. I manage to get my X axis done correctly. I can create Invode Node but i do not have the option to export image by using block diagram. I'm using LV 7.1. I want to output this to a .jpg by using program after i get my 2 1D array based on the graph. Is there another way to do that?
0 Kudos
Message 6 of 14
(30,595 Views)

Hi ander99,

 

In LabVIEW 7.1, the instructions to export image are here:

 

  • Saving Graphs, Charts, Tables, and Digital Data Controls as Images—Right-click a graph, chart, table, or digital data control or indicator and select Data Operations»Export Simplified Image from the shortcut menu to save an image of the control or indicator to the clipboard or as a .emf or .bmp file.

 

I found this from the LabVIEW 7.1 new features page here: http://zone.ni.com/reference/en-XX/help/lv/71/lvhelp/whatsnew/

 

If you want your program to do the exporting automatically, you will need to use the invoke node rather than the right click option.  Attached is an example of how you can use the invoke node to export your image.

 

 

Message Edited by vernyew.lim on 03-03-2009 08:53 PM
Best regards,
Vern Yew
Applications Engineer
0 Kudos
Message 7 of 14
(30,587 Views)

Hi Vern Yew,

 

Thank for your information. I am trying to using the invoke node function. But i can't get the export image function from the invoke node. I can't find the function that why i can't do as what you show me in your screenshot.

0 Kudos
Message 8 of 14
(30,574 Views)

I added a picture as below

0 Kudos
Message 9 of 14
(30,571 Views)

Hi ander99,

 

As I do not have LabVIEW 7.1 on my PC, I cannot try to find the right method, but from your screenshot there is one method called Get Image. Have you considered trying that one yet?

Best regards,
Vern Yew
Applications Engineer
0 Kudos
Message 10 of 14
(30,564 Views)