change order of traces and images
marcel gateau
I have graphs containing traces and images. Traces appear above images, I would like to have it the other way around. How can I do it?
(my images are transparent in most of the places, I would like to see the traces in these regions)
There's no simple way to do that.
Perhaps you could draw a polygon on the UserBack layer, instead?
Another not-simple way is to make a subwindow to hold the image.
Make the subwindow the same size as the graph with the traces, and hide the subwindow's axes once you get them aligned with the host (use fixed margins for both the graph and subwindow, and use the same axis ranges).
Here's an example:
Make/O/N=(20,20,4)/U/B threed=enoise(255) // rgba image, partially transparent
Make/O/N=20 line= p // 0..19 trace to display below image
Graph0()
End
Window Graph0() : Graph
PauseUpdate; Silent 1 // building window...
Display /W=(428.25,59,1128.75,601.25)/T line
ModifyGraph margin(left)=43,margin(bottom)=43,margin(top)=43,margin(right)=43
ModifyGraph lSize=3
SetAxis left -0.5,19.5
SetAxis top -0.5,19.5
ShowTools/A
Display/W=(0.2,0.2,1,1)/FG=(FL,FT,$"",$"")/HOST=#
AppendImage/T threed
ModifyGraph margin(left)=43,margin(bottom)=43,margin(top)=43,margin(right)=43
ModifyGraph mirror(left)=0,mirror(top)=2
ModifyGraph noLabel=2
ModifyGraph axThick=0
RenameWindow #,G0
SetActiveSubwindow ##
EndMacro
June 2, 2023 at 11:02 am - Permalink
In reply to There's no simple way to do… by JimProuty
I liked the suggestion of using the UserBack layer... unfortunately, I could not place the polygon between the traces and the image, it is always in front. I tried setting the polygon to the back, no effect. I tried bringing the image to the front, no effect... Is there a bug?
June 6, 2023 at 03:03 am - Permalink
It might be best if you post your Igor experiment file here, or contact support@wavemetrics.com. Send your Igor experiment file as an attachment if you contact support.
June 6, 2023 at 10:43 am - Permalink
What I was suggesting was to not use any traces at all, replacing them with unfilled-polygons on the UserBack layer.
That would place the polygons behind the image.
There is no "Move to Front" for an image.
Alternatively, you could create a picture of the image and draw that on the UserFront or ProgFront layer.
I wonder if you are familiar with setting the drawing layer?
DisplayHelpTopic "Drawing Layers"
June 6, 2023 at 10:44 am - Permalink
In reply to It might be best if you post… by johnweeks
Here is an example of the numerous Graphs in which I combine traces (circles) with images. The images are 2D histograms, which are transparent for Z<1200. In the regions where they are not transparent, I would like them to hide the traces. SInce I have to do this on numerous graphs, it would be nice if there could be a not-too-manual solution.
Thanks for your help!
June 8, 2023 at 01:43 am - Permalink
I think you want to place only *some* traces behind your images, not all.
So I put together a rudimentary contextual menu and Macros interface to "move" a trace to the ProgBack layer as a DrawPoly, preserving the trace's color, line size, and line style, and then the trace is hidden (not removed).
You can remove the polygon and show the trace, too.
Look for menu items in the Graph menu, but the easier-to-use menus are in the TracePopup and GraphPopup contextual menus.
Right-click a trace and choose "Move <trace> to ProgBack" to put it behind any images.
You can restore ProgBack traces from the "Restore ProgBack Trace" submenu.
I find it useful to turn on Trace Info Tags (see the Graph menu), because then when the mouse hovers over a real trace you'll see a little window describing the trace, which you won't see when the real trace is hidden and replaced with the DrawPoly on ProgBack.
June 8, 2023 at 03:36 pm - Permalink
Excellent, Jim, it's exactly what I needed, and it's professionally implemented. Thanks a lot!
June 12, 2023 at 05:12 am - Permalink