## Is there any efficient way to draw broken axis graph in SAS?

Occasional Contributor
Posts: 16

# Is there any efficient way to draw broken axis graph in SAS?

Is there any efficient way to draw broken axis graph in SAS?

Just as follow:

SAS Super FREQ
Posts: 1,226

## Re: Is there any efficient way to draw broken axis graph in SAS?

Posted in reply to HongqiuGu

With SAS 9.4M1, you can request a broken axis for one axis at a time.  Here is a blog article I wrote on this topic: Broken Axis - Graphically Speaking.  All you have to do is provide the axis ranges you want to retain.

If you don't have SAS 9.4M1, you can consider some of the techniques I discuss in this article.:

Broken Y-Axis - Graphically Speaking

Occasional Contributor
Posts: 16

## Re: Is there any efficient way to draw broken axis graph in SAS?

Posted in reply to Sanjay_SAS

Thanks Sanjay.

Graphically Speaking is a very nice blog, I have learn a lot from it .

For broken axis with double slash, like this:  "// ",  drawtext statement in PROC Template would be better.

Here is an example:

proc template;

define statgraph sgdesign;

dynamic _SEX _HEIGHT;

begingraph;

entrytitle halign=center 'Height by gender';

entryfootnote halign=left 'Broken axis demo';

layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;

layout overlay /

yaxisopts=( type=linear

offsetmin=0.0

griddisplay=on

linearopts=( viewmin=0.0

viewmax=80.0

minorgrid=OFF

minorticks=OFF

tickvaluepriority=TRUE

tickvalueformat=BEST6.

tickvaluelist=(40.0 50.0 60.0 70.0 80.0)

tickdisplaylist=("0" "50" "60" "70" "80")

)

);

boxplot x=_SEX y=_HEIGHT / name='box' groupdisplay=Cluster;

drawrectangle x=58 y=128 width=4 height=4 /

display=all outlineattrs=(color=white) fillattrs=(color=white)

transparency=0  drawspace=graphpixel anchor=left;

drawtext textattrs=(size=12pt) "/" / x=55 y=138  rotate=-45

drawspace=graphpixel anchor=left border=false TRANSPARENCY=0;

drawtext textattrs=(size=12pt) "/" / x=55 y=120  rotate=-45

drawspace=graphpixel anchor=left border=false TRANSPARENCY=0;

endlayout;

endlayout;

endgraph;

end;

run;

proc sgrender data=SASHELP.CLASS template=sgdesign;

dynamic _SEX="SEX" _HEIGHT="HEIGHT";

run;

It seems that  you'll come to China on September 4.

Hope to see you!

SAS Super FREQ
Posts: 1,226

## Re: Is there any efficient way to draw broken axis graph in SAS?

Posted in reply to HongqiuGu

The benefit of this graph is not clear to me.  There is no data below the break.  Why is this better than just a Y axis that starts at 45?

Occasional Contributor
Posts: 16

## Re: Is there any efficient way to draw broken axis graph in SAS?

Posted in reply to Sanjay_SAS

Generally, Y axis starts from non –zero is not suggested, especially for bar chart. Because it often brings us an illusion vision.

Discussion stats
• 4 replies
• 1971 views
• 0 likes
• 2 in conversation