Data visualization with SAS programming

proc sgplot, Title and Xaxis table output

Reply
Frequent Contributor
Posts: 77

proc sgplot, Title and Xaxis table output

[ Edited ]

Using SAS University Edition:

 

1) Trying to specify font, etc in Title , but getting the error message below  saying that Arial, etc is not available.

Error message in green below. I coloured the code in red.

 

2) Xaxis table: It looks fine in the output, or when I save it to HTML, although when I save to PDF, the bottom line is bold, and all the italics are in Normal style. Two screenshots are enclosed to show the difference.

 

 

 

Should I be doing something else in proc template or do I need to use a macro to add fonts?

proc template;
define style mystyle;
parent=styles.sasweb;
class graphwalls /
frameborder=off;
class graphbackground /
color=white;
end;
run;

ods listing close;
ods html style=mystyle path='.' file='newgraph.html';
ods graphics / reset=all border=off width=640 height=480;

 

proc sgplot data =Heerdt.VPPlotsforSAS1 (where=(level=2)) nowall noborder ;
Title "OR (95% upper CI) for composite estimate of Severe Vasoplegia over 24h (shaded), and at specified times up to 24 hours,
by preoperative blood pressures" Font=Arial color=black;
styleattrs datacontrastcolors=(CX18577A CX30CC6E CX666666 CXFFA700 ) ;
scatter x=Vp y=OR / yerrorupper=UCL
yerrorlower=LCL
group=Blood_Pressure1 groupdisplay=cluster clusterwidth=0.6 noerrorcaps markerattrs=(symbol=circlefilled size =5 ) ;
xaxis type =discrete;
xaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal);
yaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal);
refline 1.0 / axis=y discretethickness=1 lineattrs=(color=cxd0e0f0);
refline "24h" / axis =x discretethickness=1 transparency=0.8 lineattrs=(color=cxd0e0f0);
xaxistable total_char c2_char missing_char / location=outside VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Italic Weight=Normal);
keylegend /valueattrs=(size=10) title ="Blood Pressure" location =inside position=bottomright noborder down=1 title ="";
run;

 

 

 

WARNING: The font <sans-serif> is not available. Albany AMT will be used.
WARNING: Unable to use the Albany AMT font. The font might not be registered or more memory is needed.
WARNING: Unable to use the Albany AMT font. The font might not be registered or more memory is needed.
 
Super User
Posts: 22,874

Re: proc sgplot, Title and Xaxis table output

Posted in reply to ChristosK

I think if you check the SAS UE limitations this is one of them. 

 

  • Only these fonts are supported: Albany AMT Regular, Albany AMT Bold, Arial Unicode MS, and Cumberland AMT Regular.

https://support.sas.com/software/products/university-edition/faq/limitations.htm

 

Since SAS UE is in a locked down state, I don't think you're able to add fonts as you would in a fully licensed SAS installation.

Frequent Contributor
Posts: 77

proc sgplot, reversing order of discrete Y axis.

Along similar lines:

 

I have a new figure / table:

 

Y axis is discrete.

I want the order to be the reverse of what we have now.

Looked at

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

 

This is all I can see that is relevant:

 

DISCRETEORDER=DATA | FORMATTED | UNFORMATTED

specifies the order in which discrete tick values are placed on the axis. This option affects any plot with a discrete axis. Specify one of the following values:

DATA

places the values in the order in which they appear in the data.

Note: This value is not supported with CAS data.
FORMATTED

sorts the formatted values in ascending character order.

UNFORMATTED

sorts the unformatted values in ascending character order.

DefaultUNFORMATTED

 

 

 

Is there anything I can do to reverse this order?

 

 

proc sgplot data =VP_Table2b2 (where=(Severity ="Severe"))nowall noborder ;
Title "OR (95% CI for covariates across Vasoplegia Severity" Font=Arial color=black;
scatter x=OR y=Name / xerrorupper=UCL xerrorlower=LCL
noerrorcaps markerattrs=(symbol=circlefilled size =5 ) ;
yaxis type =discrete reverse;
xaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal)type =log logbase =e;
yaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal);
refline 1.0 / axis=x discretethickness=1 lineattrs=(color=cxd0e0f0);

yaxistable pdp2_char ORr LCLr UCLr / location=outside VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Italic Weight=Normal); run;

Frequent Contributor
Posts: 77

Re: proc sgplot, Title and Xaxis table output

Thats fine, but is there anything I can do about the table font changing when I save it as a PDF?

Frequent Contributor
Posts: 77

Re: proc sgplot, Title and Xaxis table output

Posted in reply to ChristosK

Looks like we have the same issue with the bold font in the last column of the table I just uploaded. 

Only seems to happen when I save to PDF, even though it looks OK in the output.

Super User
Posts: 22,874

Re: proc sgplot, Title and Xaxis table output

Posted in reply to ChristosK

when I save to PDF

 

How are you 'saving' to PDF, I assume you're using ODS PDF? Does Adobe issue any note/message/errors about changing the fonts, that sometimes happen if the fonts used aren't available to your PDF application. 

Frequent Contributor
Posts: 77

Re: proc sgplot, Title and Xaxis table output

Usually I press on the pdf "download results as a pdf file" button in the results window, between the RTF and word buttons.

It may be because this is a locked down version, although I thought it unlikely at first since the font in results is as I specified  .

 

However....I did try this just before the proc sgpolot data line after creating a file on my desktop to save pdf files in.

ods pdf file ="/Users/Desktop/My SAS PDF Files";
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 ods pdf file ="/Users/Desktop/My SAS PDF Files";
ERROR: Unable to open filename /Users/christoskoutentis/Desktop/My SAS PDF Files. ODS PDF initialization fails.
ERROR: The path /Users/christoskoutentis/Desktop/My SAS PDF Files is not in the list of accessible paths when SAS is in the
lockdown state.

 

At least we now know more about whet cant be done in sas studio.

 

Any idea about getting axis tables in proc sgpanel? I found a colaxis tableoption, but its not what the same as we have in procsgplot.

Also, still cant reverse the border or the variables on the Y axis (it is discrete), and I would like to align them on the left. of possible.

Lastly, can I change the alignment of the numbers in the axis tables? Ideally I would like to have the confidence intervals in brackets separated by a comma rather than a column for each values. I guess I can put those numbers with brackets etc and use that as a character variable.

 

Super User
Posts: 22,874

Re: proc sgplot, Title and Xaxis table output

Posted in reply to ChristosK

I don't know the answers to your other questions, but for ODS PDF, you have your path incorrect. When working in SAS UE you need to use the shared folder you set up at installation and the path using the myfolders. 

 

'/folders/myfolders/mydemo.pdf'

The file will be wherever you set up the shared folder.

Super User
Posts: 22,874

Re: proc sgplot, Title and Xaxis table output

PS. I realized your question was not in the graphing forum, so I've moved it to the Graph/ODS Graphics forum. Hopefully someone else can answer your question.
SAS Super FREQ
Posts: 1,265

Re: proc sgplot, Title and Xaxis table output

[ Edited ]
Posted in reply to ChristosK

Yes, you can use ROWAXISTABLE and COLAXISTABLE in SGPANEL.  If you want special formatting of the values in the table, you will have to construct the test string yourself in a column, and use that to display the values in the axis tables.  See the 2nd column in this example of Forest Plot.

Ask a Question
Discussion stats
  • 9 replies
  • 411 views
  • 3 likes
  • 3 in conversation