From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot a 1D array and a 2D array in a single plot/chart.

Solved!
Go to solution

I have a 2D data of an image of size 1000x1024 and I have a 1D graph of size 1x1024. How can I plot both of them in a single plot/chart? Both the data are in the form of an array.

0 Kudos
Message 1 of 12
(3,369 Views)


Use the PlotImages.Back property of an XY-graph to plot the image: https://zone.ni.com/reference/en-XX/help/371361R-01/lvprop/mxsiggrph_plot_imagesback/

Certified LabVIEW Architect
0 Kudos
Message 2 of 12
(3,336 Views)

But the data which I have is in 2D array form and the images are generated from a machine and not imported from a file. So every time the code runs, there will be a new image. That's why I need to plot it as an array on another array.

0 Kudos
Message 3 of 12
(3,324 Views)

@yp96 wrote:

But the data which I have is in 2D array form and the images are generated from a machine and not imported from a file. So every time the code runs, there will be a new image. That's why I need to plot it as an array on another array.


"2D array form". Is it an RGB image represented as a 2d-array? Then just use "draw flattened pixmap". No need to import a file.

 

What do you mean by "plot an array on another array"? Can you show us some data and what you want to do, or some code, or pictures?

Certified LabVIEW Architect
0 Kudos
Message 4 of 12
(3,319 Views)

In the attached image, the generated image can be seen above and the plot below. The image is obtained from the machine in the form of pixel values and then I have done coding to obtain the topmost edge in the image. Now I need to visualize that graph plot over the original image to see how well is the edge detected. I hope this makes it clear what I want to do.

 

I also attached a VI - trial_plot. It consists of both the image and the plot data.

Download All
0 Kudos
Message 5 of 12
(3,314 Views)

Why not add the new graph to the 2D one?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 12
(3,306 Views)

I tried adding using the build array, no results. I only see the image and when I see into properties of the plot, I don't see the tab of Plots to change the color of the line graph. How would you suggest to add it?

0 Kudos
Message 7 of 12
(3,303 Views)

You can r-click and Show Legend, if memory serves, there you can set plot properties as color.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 12
(3,300 Views)

I tried and I didn't see any such option. Could you please show it in the attached VI?

0 Kudos
Message 9 of 12
(3,295 Views)
Solution
Accepted by topic author yp96

Ah, its an intensity graph. Rarely had to use those. I have attached the simplest solution. Just overlay the XY-graph and make it transparent.

 

 

Certified LabVIEW Architect
0 Kudos
Message 10 of 12
(3,292 Views)