Hello,
Is it possible to create a break in the x-axis with the range following the break at a different distribution/scale than the data prior to the break? For example, prior to the break the x-axis ranges from 0 to 11 by 1, taking up the majority of the graph space. After the break at 11, the range is from 11-16 by 1, but more condensed, only occupying the last 10% or so of the graph. (Most data to display occurs prior to x=11.) I've attached a screenshot of the desired x-axis with the break and proper distributions prior to and after the break.
Thanks so much in advance!
As a start have a look here https://blogs.sas.com/content/graphicallyspeaking/2012/05/31/broken-y-axis/ it provides a code sample that does the break of an axis "manually". You will have to use the GTL (Graph Template Language). I have taken the above example and adapted it for a broken X axis. Since you did not provide any data and what kind of plot you want I assumed something.
See this sample:
data plotdata;
do month = 1 to 14;
value = rand("integer", 10, 20);
output;
end;
run;
/*-- manual break in axis --*/
proc template;
define statgraph series_break;
begingraph;
/* the columweights determine the space available */
layout lattice / columns=2 rowdatarange=union columnweights=(0.9 0.1) ;
layout overlay /
xaxisopts=(
griddisplay=on display=(ticks tickvalues label)
tickvalueattrs=(size=7)
linearopts=(viewmin=1 viewmax=11 TICKVALUELIST=(1 2 3 4 5 6 7 8 9 10))
offsetmax=0
);
seriesplot x=month y=value;
endlayout;
layout overlay /
xaxisopts=(
griddisplay=on display=(ticks tickvalues)
tickvalueattrs=(size=7)
linearopts=(viewmin=11 TICKVALUELIST=(11 12 13 14))
offsetmin=0
)
yaxisopts=( display=none)
;
seriesplot x=month y=value;
endlayout;
endlayout;
endgraph;
end;
run;
ods graphics / reset=all;
proc sgrender data=plotdata template=series_break;
run;d
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.