09-21-2010 09:19 AM
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
Solved! Go to Solution.
09-22-2010 07:55 AM
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.
09-22-2010 09:40 AM
@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...
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.
09-22-2010 01:41 PM - edited 09-22-2010 01:41 PM
I would put the image into the background of a standard XY Graph and change the size and scales to match the image size.
09-23-2010 02:22 PM
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.
09-23-2010 02:25 PM
I believe the coercions are TypeDef related, nothing to worry about here.