By default whenever data is plotted it contains a margin of 8% between the data and the axes of the graph. This is meant to show the entirety of the data, however many publications have very specific requirements that depart from this. The sample data used for this blog post is Multiple_Peaks.dat, which can be found in your Origin folder under Samples>Curve Fitting.
Rather than going into each graph and changing their ranges manually, in this blog we’ll be showing you how you can use Origin themes to change the default margins of any generated graph.
Once you’ve plotted our sample data, or otherwise create a normal x/y plot from any other values, you’ll want to open the Axis Dialog and then in the Scale tab change the Rescale Margin(%) to the desired value. In this case we have changed the margin % to 0% for the x axis and 2.5% for our y-axis.
After hitting apply and closing out of the dialog, you can click the Rescale button to see how future graph margins will appear. Next we’ll create a theme from these settings which we can use to apply to any and all future graphs. To do this, right click on the graph and select Save Format as Theme…
This will open the dialog window of the same name where you will find all properties attached to that theme. Since we’re only interested in the X and Y axis Rescale Margins, we’ll want to click the button with the pencil icon (which may have a red X through it) and in the Formats to Save group, uncheck “All”, and check “Scale”. After clicking the pencil icon to reopen the property list, you should see folders for the X and Y axis as well as an “All Axes” folder. Rescale Margin will only appear under the All Axes folder if the two rescale margins have been given the same value. Since ours are different they will appear as separate properties in the X and Y Axis folders; because of this we’ll right click on the All Axes folder and delete it entirely. Then in the X and Y axis folders remove the From, To and Value properties this same way. Give your theme a name, in this case we’ve chosen “FixedMargins” and then click OK.
You can open the Preferences: Theme Organizer dialog. Select this FixedMargins theme and apply it to existing graphs in the project.
If you look at the Theme Organizer dialog, there is a theme Light Grids which is bold. Bold means it’s the system theme. When plotting any new graph in Origin, no matter it’s scatter, line, column, etc., Origin will apply the system theme to it. Origin doesn’t support setting mutliple system themes. But you can Ctrl+ select both Light Grids theme and FixedMargins theme. Right click and choose Combine.
A new theme, named “Combined theme” by default, will be generated combining the features of both of the other two themes. To activate this as the system default, right click on it and select Set as System Theme.
Close out of the Theme Organizer and then go to replot your data or make another plot in a different OPJ altogether.
As you can see, once our data has been plotted a second time, there will be no margin between the data and the axis.
This is one simple example of how different properties can be saved as themes and incorporated into the system defaults for future use. We have many built-in graph themes so you can easily modify and combine them to make new system theme that fits your graphing needs, such as All Ticks In + Times New Roman Font for example.