04-19-2012 12:28 PM
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.
04-19-2012 01:17 PM
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...
04-19-2012 02:09 PM
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.
04-19-2012 02:19 PM
I put in a request for this enhancement a while back - I'll add a note to that request to let developers know you're also interested.
S0307966 NewFeature:GPLOT SUGGESTION:
ADD OPTION TO PRESERVE 1/1 ASPECT RATIO OF THE AXES
04-19-2012 02:29 PM
Great! Thank you Robert. GPLOT is only one place where this would be useful, GCONTOUR when used in conjunction with geotatistics procedures, for example, could also benefit from that option. - PG
04-19-2012 06:46 PM
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.
04-20-2012 05:51 PM
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?
04-21-2012 09:39 PM
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!