Data visualization with SAS programming

proc sgplot Outlines

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 77
Accepted Solution

proc sgplot Outlines

How do you print a graph in proc sgplot with the only outline being the lines of the X and Y axes?

 

Specifically, I don't want a line where the Y2 na X2 yes would be.

 

 


Accepted Solutions
Solution
‎02-03-2018 03:41 PM
Super User
Posts: 23,319

Re: proc sgplot Outlines

Posted in reply to ChristosK

Not sure if your problem is solved or if you're still looking to remove the additional lines. If so, the documentation has the answer Smiley Happy

 

http://documentation.sas.com/?docsetId=grstatproc&docsetTarget=p0wvmd88sz151ln1i1vx8l72b73c.htm&docs...

 

DISPLAY=ALL | NONE | (options)

specifies which features of the axis are displayed. ALL displays all of the features of the axis. NONE specifies that none of the features of the axis are displayed. You can also hide specific features. options can be one or more of the following:

NOLABEL

hides the axis label

NOLINE

hides the axis line

Tips This value hides the axis line, but has no effect on the graph border. To hide the border, specify NOBORDER in the PROC SGPLOT statement.
This value has no effect on baselines. For plots that support a baseline, such as bar charts and needle plots, you might need to suppress the baseline. In the plot statement, use the BASELINEATTRS= option to set the line thickness to 0.

View solution in original post


All Replies
Super User
Posts: 23,319

Re: proc sgplot Outlines

Posted in reply to ChristosK

You can specify the customization for the X2AXIS and Y2AXIS and I believe Display=None will allow you to suppress the lines.

SAS Super FREQ
Posts: 497

Re: proc sgplot Outlines

Posted in reply to ChristosK
Frequent Contributor
Posts: 77

Re: proc sgplot Outlines

Posted in reply to WarrenKuhfeld

Thank you Warren and Reeza for the options.

 

I tried this:

 

 

proc sgplot data = spline;
yaxis label = "Estimated probably of Vasoplegia within 24h in ICU";
xaxis label = "Induction SBP";
band x=Ind_dbp1 lower=l upper=u;
series x = ind_dbp1 y = u/ curvelabel = "Upper CI";
series x = ind_dbp1 y = l/ curvelabel = "Lower CI";
series x = ind_dbp1 y = p/curvelabel = "Predicted value";
where VP_v24Hr_vasone_02 = .;
x2axis display=noline;
y2axis display=noline;
run;

 

Also looked at the link Warren suggested. What I had in mind was more like the second animal figure, although the X and Y axes are not here too. I know that you do understand what I meant by the X2 and Y2 axes as there are no alternatives, but in the first figure on the link you have "Ratings for Automobiles manufactured in 1980" on the X2 axis. Thats one of the two lines I want to make disappear. Results of above code are included.

 

Thanks,

 

Christos

Frequent Contributor
Posts: 77

Re: proc sgplot Outlines

[ Edited ]
Posted in reply to WarrenKuhfeld

Thank you Warren and Reeza for the options.

 

I tried this:

 

 

proc sgplot data = spline;
yaxis label = "Estimated probably of Vasoplegia within 24h in ICU";
xaxis label = "Induction SBP";
band x=Ind_dbp1 lower=l upper=u;
series x = ind_dbp1 y = u/ curvelabel = "Upper CI";
series x = ind_dbp1 y = l/ curvelabel = "Lower CI";
series x = ind_dbp1 y = p/curvelabel = "Predicted value";
where VP_v24Hr_vasone_02 = .;
x2axis display=noline;
y2axis display=noline;
run;

 

Also looked at the link Warren suggested. What I had in mind was more like the second animal figure, although the X and Y axes are not here too. I know that you do understand what I meant by the X2 and Y2 axes as there are no alternatives, but in the first figure on the link you have "Ratings for Automobiles manufactured in 1980" on the X2 axis. Thats one of the two lines I want to make disappear. Results of above code are included.

 

Thanks,

 

Christos

Solution
‎02-03-2018 03:41 PM
Super User
Posts: 23,319

Re: proc sgplot Outlines

Posted in reply to ChristosK

Not sure if your problem is solved or if you're still looking to remove the additional lines. If so, the documentation has the answer Smiley Happy

 

http://documentation.sas.com/?docsetId=grstatproc&docsetTarget=p0wvmd88sz151ln1i1vx8l72b73c.htm&docs...

 

DISPLAY=ALL | NONE | (options)

specifies which features of the axis are displayed. ALL displays all of the features of the axis. NONE specifies that none of the features of the axis are displayed. You can also hide specific features. options can be one or more of the following:

NOLABEL

hides the axis label

NOLINE

hides the axis line

Tips This value hides the axis line, but has no effect on the graph border. To hide the border, specify NOBORDER in the PROC SGPLOT statement.
This value has no effect on baselines. For plots that support a baseline, such as bar charts and needle plots, you might need to suppress the baseline. In the plot statement, use the BASELINEATTRS= option to set the line thickness to 0.
SAS Super FREQ
Posts: 497

Re: proc sgplot Outlines

Posted in reply to ChristosK

proc sgplot data=sashelp.class noborder;
scatter y=height x=weight;
run;

 

Is this what you want?

Highlighted
Frequent Contributor
Posts: 77

Re: proc sgplot Outlines

Posted in reply to WarrenKuhfeld

Thank you Reeza and Warren. 

noborder works perfectly.

The other pointers are intriguing as well. Trying to minimize the ink relative to the data points in the graphs.....and getting there!

 

Christos 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 225 views
  • 2 likes
  • 3 in conversation