LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot a Point at a Pixel

Solved!
Go to solution

The Help article for Plot XY.vi led me to believe that "data" input argument was x and y pixel coordinates. So for an image that is 804x347, the point (400,175) should end up near the center of the image (near the bottom of the e in Fed if you're looking at the FedEx truck picture I attached - there's actually a point plotted there but the datatip is smothering it).

 

Instead, Plot XY.vi plots the points like a regular graph - if 400,175 is the only point, it ends up at the origin. Messing with the axes specs doesn't seem to help.

 

How do I specify pixel coordinates and plot a point at that location?

 

Andrew

Andrew
Download All
0 Kudos
Message 1 of 6
(4,222 Views)

The picture control might be a better option, since it uses pixels for the coordinate system.  The XY graph is supposed to use the axis units for the coordinate system.  You could use VI server to query the display size, set the axes to those limits, then plot your point, but it would be easier to use a picture control.   See the LabVIEW help for details.  Let us know if you run into problems.

0 Kudos
Message 2 of 6
(4,190 Views)

 


@DFGray wrote:

The picture control might be a better option, since it uses pixels for the coordinate system. 


 

The "Plot XY" VI does use the picture control. It generates a picture... Smiley Wink

 

 

To arcranda: I'm having a hard time understanding the issue, as I can't see what you are referring to as the "center" point.

0 Kudos
Message 3 of 6
(4,163 Views)
Solution
Accepted by arcranda

I would put the image into the background of a standard XY Graph and change the size and scales to match the image size.

 

 

 

 

 

0 Kudos
Message 4 of 6
(4,148 Views)

smercurio,

 

The centerpoint was in "Truck in MATLAB.jpg". I attached two images and didn't specify which one to look at --- my mistake. I was trying to emulate the way MATLAB plots points on images and I thought Plot XY would do the job but it didn't - it wasn't treating the points I gave it as pixel coordinates.

 

Darin's solution is just what I wanted. Just out of curiosity, why is it coercing the input to PlotAreaSize?  The Height and Width properties are expecting V32s and I made sure to convert before I bundled them. 24614i20336A17482C5369

Andrew
0 Kudos
Message 5 of 6
(4,120 Views)

I believe the coercions are TypeDef related, nothing to worry about here.

0 Kudos
Message 6 of 6
(4,115 Views)