In SAS Graph the AXIS statment has the option
specifies the length of the axis in number of units. If you request a length that cannot fit the display, a warning message is written to the log and your graph may produce unexpected results. (from the online help)
That might fit your need.
For example ...
In the following graphs, I use:
axis1 length=2.3in offset=(0,0) order=(0 to 60 by 10) minor=none;
axis2 length=2.3in offset=(0,0) order=(0 to 60 by 10) minor=none;
And then in the gplot I use them as ...
Which produces these nice plots with proportional axes:
for the full code, see...
Very nice graphs! But as usual, a lot of tinkering required. One has to figure out the X and Y ranges, decide on tick mark values and translate that into physical dimensions. Quite a bit more trouble than I got used to expect since the advent of SG- procedures... and incompatible with BY processing unless one wants UNIFORM graphs.
I don't know what the demand would be for a feature such as XYRATIO=, but I am sure any improvement in that direction would promote the proper visual representation of related units.
With SAS 9.2 you can use GTL with LAYOUT OVERLAYEQUATED to create a graph with a real 1:1 ratio. Here is an example of the usage of such a layout with a SCATTERPLOT statement: In this case the LINEPARM with slope=1 is actually a 45 degree line in the graph.
define statgraph equated;
entrytitle 'City and Highway Mileage';
layout overlayequated / equatetype=square;
scatterplot x=mpg_highway y=mpg_city;
lineparm x=10 y=10 slope=1 / curvelabel='Slope=1.0';
ods graphics / reset width=3in height=3.2in imagename='Equated';
proc sgrender data=sashelp.cars template=equated;
Here is another example of usage of the Equated layout: Map Overlays. LAYOUT OVERLAYEQUATED has three different EquateType of FIT, SQUARE and EQUATE. You can make the scales equal, but there not a way to have guaranteed equal lengths.
It will be in the SG family, but it is not as simple as adding to SGPLOT. We need to consider if this should really be a separate procedure, since many of the options (and statements) avaialble in SGPLOT will not be valid for this case.
We are considering a SGEQUATED procedure. This will only plots with allow numeric (linear) values on the axes, and many axis options will be common (to X & Y), and will need a EquatedAxis statement. There are benefits to separating it out (cleaner syntax and implementation). I don't yet see the benefit of adding this into SGPLOT.
Do you see any benefits of adding this feature into the SGPLOTprocedure? In GTL, this is a whole separate layout container. Opinions?
From my casual user perspective, this feature would simply affect the scaling of the axes, and only when they are both continuous and of the same type (linear, log or time). I don't see what else would be affected. I enjoy very much the (apperent) simplicity of statistical graphics procedures. I trust you guys to keep them that way, as much as possible. Thanks!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.