![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
Saving Graphics with the Same Size/Layout
![](/sites/default/files/styles/thumbnail/public/jasonjphillips/profile-images/2022-09/cthuluneg.jpg?itok=bLIhbB5W)
I have more than 5 graphs plotted in my experiment. I drag one graph window to a size that makes the legend, tick marks, etc. look good for saving the graph as an image to embed into a presentation; I'd like to get all of the other graphs to match. All of the graphs are basically the same type/format.
Question 1: Is there an easier way to do this than stacking the windows and manually dragging them to the same size, then making sure all the ticks and legend positions match? I realize that under Save Graphics there is an option for custom width and height, but that doesn't make the graphs match if the windows don't start at the same size/layout.
Question 2: Is there a setting I can change that will keep the graph settings/look FIXED when I resize the window? While the axes, ticks, etc. changing when the window is resized can be good, it is often counterproductive when I'm just trying to prepare a graph to save as an image.
Hi Jason,
Thanks for your questions. For the first one, I think a style macro might give you what you are looking for. Paste the following in the command window to read up on how they work:
DisplayHelpTopic "Graph Style Macros"
For your second question, I believe the Modify Graph dialog will help you out. Right-click on the graph and select Modify Graph (or Graph -> Modify Graph). I might suggest Absolute Width and Height modes and setting the margins to specific values instead of Auto. You can read up on resizing details here:
DisplayHelpTopic "Graph Dimensions"
Thanks,
Kris
June 28, 2024 at 09:47 am - Permalink
For question 1 ...
Double click on the margin to the graph to bring up the dialog to set the graph dimensions. Set them to the values you desire. You will see the history print something akin to
ModifyGraph width=288,height={Aspect,0.75}
Choose each remaining graph to bring it to the front. Re-execute the command to set the frontmost graph to the same settings.
Note that these settings are the dimensions of the inner graph window. The entire graph display may be different from graph to graph especially for example when your ordinate tick labels are different widths from one graph to the other. Tweaking will involve using the margin settings as well as the width and height values.
Also, I cannot seem to get to it now, so try searching for Spectra Trace Offset ... tools package. It offers many options to tweak the graph using a UI control panel input.
June 28, 2024 at 04:49 pm - Permalink
Your issues are exactly why I wrote the Graph Tools package. You can find this here (the website seems to have issues with displaying project pages at the moment, so try again later):
https://www.wavemetrics.com/node/21562
One part of this add-on is a panel which lets you modify graph sizes, which includes copying the current size or style to another graph in seconds. So your question 1 would be solved by simply pressing two buttons with this tool. Using the tool has also the benefit of not locking the graph dimensions for resizing with the mouse, which would be the case when using fixed dimensions via the Modify Graph dialog.
You question 2 can be solved by locking whatever settings you want to not change when resizing the graph. The font can be locked from above panel or by using the Modify Graph dialog. The axes stay the same if you set the ticks manually in the Modify Axis dialog, i.e., by entering a manual spacing and number of ticks. There is also a button to fill in the current automatic tick settings.
June 28, 2024 at 06:28 pm - Permalink
Yes ... @chozo's package is the one I had in mind.
sidebar: For some reason, clicking on the link does not work from Safari macOS. Is this a bug???
June 29, 2024 at 07:50 am - Permalink
@jj: As mentioned, the website seems to be unable to process any project pages at the moment. Seems to be a hiccup at the server side. I guess this will be solved next week, when someone from the official team can have a look. (I just hope these pages are not gone for good. It would take a long time adding all the stuff back in ...)
June 29, 2024 at 10:23 am - Permalink
Same thing on my end with the link. I'll keep trying it.
I'll also play around with the other suggestions given.
Thanks, all!
July 1, 2024 at 06:37 am - Permalink
I'll attach the latest version here for now. Unfortunately the user manual was also on the website... Here are just the essentials. Let me also know if you don't know how to install such additional procedures.
- After including the procedure, there is a new menu 'Spectra Tools' at the top bar.
- Click on the graph you want to edit and invoke the Graph Size Panel from the menu.
- Clicking on another graph and then the panel again will make this graph the focus of all edits. In other words, the panel will always act on the top graph.
- The controls should be pretty self-explanatory, but you can hover over each control to display a tooltip message if you are not sure.
July 1, 2024 at 07:01 am - Permalink
Thanks! Does it just need to get copied into the Igor Procedures folder? Then it shows up under Windows>Procedure Windows?
July 1, 2024 at 07:24 am - Permalink
If you put this into
...\Documents\WaveMetrics\Igor Pro 9 User Files\Igor Procedures
then the package will always be loaded in Igor (which should be fine... I have made sure that the code does not interfere with Igor, but you will always have extra menu entries etc. from the package of course).
If you put this into
...\Documents\WaveMetrics\Igor Pro 9 User Files\User Procedures
you can load the package whenever needed via an #include statement, but it will not be loaded automatically upon start.
July 1, 2024 at 07:33 am - Permalink
I just started messing with it; that is a fantastic tool! Just being able to Copy/Paste graph sizes is amazing.
Thank you.
July 1, 2024 at 11:03 am - Permalink
Great that this is useful for you. Now the links to projects seem to work again, so have a look at the manual (and maybe my other projects).
July 1, 2024 at 09:16 pm - Permalink
In reply to Great that this is useful… by chozo
Projects are back up with downloads, too.
July 3, 2024 at 10:16 am - Permalink