12-25-2023 12:32 PM
Hello, I have a problem. I need to create XY Graph in 2D Picture control. I've checked it with the Graph XY, it works just fine. But now I have no idea, how to make the same graph in 2D Picture. Maybe you could advice literature on this topic, or something. I use LabView 2010, and started learning it pretty recently .
Thanks.
Solved! Go to Solution.
12-25-2023 03:12 PM
You do realize, I hope, that you are making a bitmap image. I won't ask why ...
You are very close. Did you notice there are a bunch of functions on the Graphics & Sound/Picture Plots Palette, one of which is named Plot XY.vi? This takes an array of "points", where a point is a cluster of X and Y values. You already have a pair of arrays of X and Y, and I assume you know how to turn these two Arrays (of the same size) into an Array of X-Y clusters (pass the two Arrays into the same For Loop, where they become simply an X and a Y value, and drop a "Bundle" Cluster function in, wire X on top and Y on the bottom, and bring the Cluster out the right edge of the For through the Indexing Tunnel, and you have an Array of Clusters).
This goes into the "data" input of the Plot XY function. When I ran this, I said "??? This did nothing!", and then I squinted and saw a picture of pale yellow on a white background! Look at the bottom connectors of the Plot XY function, called "XY plot cosmetics". I set the Plot Color to Red, and got this:
Pretty awful, I'd say. Got to figure out how to make the plot fit into the Picture, lots of other fiddling. It does resemble the XY Graph once you make the X and Y axes about the same size ...
Read the Help for Plot XY and learn how all those other inputs to this function work.
Bob Schor
12-25-2023 03:52 PM
Thanks a lot, that helped. Will be playing around with cosmetics now.