Using "SetMarquee" with scaled coordinates

Hello,

I'm trying to display a marquee on a graph by entering the scaled values. As written in the manual, "the optional axis modes supported by GetMarquee are not supported by SetMarquee." Thus, one has to convert the scaled coordinates in order to display the marquee. I noticed that the margin in taken into account, so I've set the margin values, as well as the other graph dimensions (I tried to set the width and height both in "absolute" and in "per units" modes. Despite these precautions, I'm still unable to get what I want. That is to say, if I set the top margin to 30 points, and if I type :
 setmarquee /W=CAPTIVOCS_Panel#G0 30,30,130,480
The marquee left-top corner of the marquee is not located at the cordner of the graph

My question is :
Is there any other thing to pay attention on in order to properly Set a Marquee using the scaled corrdinates?

Please find attached the screenshot.

Thank you in advance
Hi Nasser,

have you tried using PixelFromAxisVal to convert your scaled coordinates into graph pixel coordinates and then use SetMarquee? This function should take the margins into consideration.

Hope that helps,
Thomas
Hello Thomas,

Thank you for your answer.

Unfortunately, the SetMarquee coordinates are in points, not in pixels. That is to say, it depends on the graph dimensions and on the margins also. I think that another thing which has to be taken into account is the fact that the graph is in a subwindow.

Best Regards
Yes you are right, you still have to convert it.
This can be done using Screenresolution. I'm currently not sure how the subwindow influences your coordinates, but GetWindow might come in handy, if you need to have reference values for some pixel/point positions.

Thank you very much, it's working !

Actually,the margins don't have any effect.

Here is an example :

variable  B_px,T_px,L_px,R_px

B_px = PixelFromAxisVal("My_Panel#G0","left", 100)
T_px = PixelFromAxisVal("My_Panel#G0","left", 200)
L_px = PixelFromAxisVal("My_Panel#G0","top", -10)
R_px = PixelFromAxisVal("My_Panel#G0","top", 0)

Variable B_points = B_px * (72/ScreenResolution) // Convert pixels to points
Variable T_points = T_px * (72/ScreenResolution) // Convert pixels to points
Variable L_points = L_px * (72/ScreenResolution) // Convert pixels to points
Variable R_points = R_px * (72/ScreenResolution) // Convert pixels to points

SetMarquee /W=My_Panel#G0 L_points, T_points, R_points, B_points


Best Regards