Hi, All:
I am trying to generate graph that includes Broken Y axis.
For expressing broken axis, I used SGANNO= function, and I noticed this axis-broken marks (and reference line) are slightly thicker than X & Y axes.
I would like to change these line widths and make them all look like same, but I have no ideas.
I want them to have 0.5 pt widths. Please help me.
Sample code & output example are below.
Thank you in advance.
data test;
length subjid $200.;
subjid="001"; time=0; aval=40; output;
subjid="001"; time=1; aval=80; output;
subjid="001"; time=2; aval=70; output;
subjid="002"; time=0; aval=85; output;
subjid="002"; time=1; aval=90; output;
subjid="002"; time=2; aval=50; output;
run;
proc format;
value fval
20="0" 40="40" 60="60" 80="80" 100="100";
run;
data breakline;
function="line"; x1=-0.02; y1=31.0; x2=0.02; y2=31.0; drawspace="datavalue"; linecolor="black"; output;
function="line"; x1=-0.02; y1=30.0; x2=0.02; y2=30.0; drawspace="datavalue"; linecolor="black"; output;
keep drawspace function linecolor x1 y1 x2 y2;
run;
proc template;
define style style2.mystyle;
parent=styles.listing;
class graphwalls / frameborder=off;
end;
run;
ods graphics on / reset
imagename="test" imagefmt=emf border=off
width=6in height=5in
;
ods rtf file="PleaseSpecifyYourOwnFolder\test.rtf";
proc sgplot data=test noautolegend sganno=breakline;
series x=time y=aval / group=subjid lineattrs=(pattern=1 color=black thickness=0.5pt);
xaxis labelattrs=(color=black family="Times New Roman" size=9pt) label="Time Point"
values=(0 to 2 by 1) valueattrs=(color=black family="Times New Roman" size=9pt) offsetmin=0 offsetmax=0.05;
yaxis labelattrs=(color=black family="Times New Roman" size=9pt) label="Test Value"
values=(20 to 100 by 20) valueattrs=(color=black family="Times New Roman" size=9pt) offsetmin=0 offsetmax=0.02;
refline 40 90 / lineattrs=(color=black pattern=shortdash thickness=0.5pt);
format aval fval.;
run;
ods rtf close;
In the annotation data set, you can set LINETHICKNESS=1 to make it match the axis line.
Hope this helps!
Dan
In the annotation data set, you can set LINETHICKNESS=1 to make it match the axis line.
Hope this helps!
Dan
Hi, DanH-san:
Thank you for your quick reply. Your code worked for me.
I read SAS Manual and I think LINETHICKNESS= option can have values, 1, 2, or 3.
Thanks to your explanation, I understand "1" means same as the axis line width.
Really thanks!!
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.