Setting x and y axis with same range

Folks,

I'm new to Igor and I'm having trouble plotting a graph so that X and Y axis are of equal width. For example, both X and Y axis are of same units (metres), and I would like to plot it so that if X ranges from 3 (min) -10 (max) metres, I want Y axis to also range from a minimum to maximum so that the total range is 7 metres. Though I can do this by changing the axis properties after the graph is displayed, I was wondering if there is a command that I can use to do it in the function. I looked into the 'SetAxis' command, but I couldn't figure out how to set one axis based on the range of the other axis. Any help would be great. Thanks.
Try the code snippet posted here. Paste the code in to your procedure window. Then, look for the Windows : Panel Macros : ScaleGraph panel menu to open the panel.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
Use GetAxis in your code to find out the range of an axis. Then you can use SetAxis to set the range of the other.

In addition, if you want the graph to be square, you may want to set the size mode to Aspect or Plan mode. You do that with the ModifyGraph command, using keywords width or height. You can read about these size modes:

DisplayHelpTopic "Graph Dimensions"

If you want your SetAxis code to respond to user-set axis range, you can use a window hook function:

DisplayHelpTopic "Window Hook Functions"

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com