BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChristosK
Quartz | Level 8

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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 🙂

 

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

7 REPLIES 7
Reeza
Super User

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

ChristosK
Quartz | Level 8

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

ChristosK
Quartz | Level 8

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

Reeza
Super User

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 🙂

 

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.
WarrenKuhfeld
Rhodochrosite | Level 12

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

 

Is this what you want?

ChristosK
Quartz | Level 8

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 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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