02-27-2019 04:23 AM
Hello,
I just wonder how this intensity graph with numeric values plotted on it (Figure 2) was made :
Do you have any idea ?
Thank you for you help.
02-27-2019 05:14 AM - edited 02-27-2019 05:19 AM
He used the image overlay (property) of the graph. I think that was given as advice on one of his questions, but can't find it*.
You'll have to calculate the positions of the text (basic linear interpolation in X and Y direction), draw the text in an image, and put it in the graph.
* EDIT: maybe this one: https://forums.ni.com/t5/Machine-Vision/Draw-line-or-a-dot-for-a-specific-pixels-on-the-image/m-p/30... EDIT: never mind, that's about IMAQ.
02-27-2019 09:55 AM
I would put transparent array on top of intensity graph
02-27-2019 10:15 AM
@Alexander_Sobolev wrote:
I would put transparent array on top of intensity graph
I wouldn't. ![]()
02-27-2019 01:53 PM
Have you considered using the annotations?
Ben
02-27-2019 02:00 PM
Hello,
Thank you all for your solutions.
I’ve almost finish doing the solution with the front image. I will post the code once completely done. However I’m not a Labview expert so be kind with me...
I didn’t know about annotation, I will further investigate it seem very interesting.
best regards
02-28-2019 01:59 AM
@haha1234 wrote:
I’ve almost finish doing the solution with the front image. I will post the code once completely done. However I’m not a Labview expert so be kind with me...
You'll get credit for effort, and advice (you didn't ask for) for free! No downside!
@haha1234 wrote:
I didn’t know about annotation, I will further investigate it seem very interesting.
Annotations are pretty neat, but I think there where some problems when using them in practice. I'm not sure, but I think they get sluggish when you have a lot (>50?) of them? Maybe that got fixed by now, worth a try.
02-28-2019 05:27 AM - edited 02-28-2019 05:28 AM
wiebe@CARYA wrote:
Annotations are pretty neat, but I think there where some problems when using them in practice. I'm not sure, but I think they get sluggish when you have a lot (>50?) of them? Maybe that got fixed by now, worth a try.
I tried with 100 and set to a fix position via allow drag = false
is there an easy way to calculate a dynamic offset for the label position?
e.g. how to derive the width and height of one super-pixel?
02-28-2019 06:07 AM
@alexderjuengere wrote:
is there an easy way to calculate a dynamic offset for the label position?
e.g. how to derive the width and height of one super-pixel?
Not sure if that is required, as the coordinates seem to be scale space... So .5 should be the middle.
Anyway, to go from scale space to pixel space, you have two options. There are methods Map Coordinates to XY and Map XY to Coordinates. That should do the trick, but you'll need to do some math as the coordinates are pane coordinates. So you need to subtract the graph area position...
The other way is to get the width and height of the graph area, and the min and max scale (those could be flipped!) and do the interpolation yourself...
For both methods, if you want a relative position (like an offset), you don't need a full linear interpolation, just a linear scaling.
02-28-2019 06:15 AM
BTW. The presentation in this thread is about the image overlay.
https://forums.ni.com/t5/LabVIEW/Plotting-Types/td-p/3687321
And note the hint that the code should be organized, as it intentionally isn't.