BookmarkSubscribeRSS Feed
AsthmaticRunner
Calcite | Level 5

I have created my graphs, however, I want to customize them.  However, when I have attempted the save as HTML open in Excel I get the "red box of death" where the graphs should be.  (That code is below.)  I then attempted the ODS Excel but I get the error message: 

 
ERROR: Insufficient authorization to access /pbr/biconfig/940/Lev1/SASApp/sasexcl.xlsx.
 
I do not want to recreate these graphs by hand.  What do I need to do to be able to export them into something (anything at this point) which I can adjust colors/fonts, etc for use in my Master's Capstone project.  I have exported the RTF file, but it exported the graphs as pictures which means I still can't edit them.  Help?
 
**EDIT: Code below**
 
Data vpp;
Set homework.vpp;
run;
ODS graphics;
proc univariate data=homework.vpp normal mu0=12;
var Correct_before;
histogram Correct_before/normal;
run;
ODS graphics off;
ODS graphics;
proc univariate data=homework.vpp normal mu0=12;
var Correct_after;
histogram Correct_after/normal;
run;
ODS graphics off;
ODS graphics;
proc univariate data=homework.vpp normal;
var Difference_Correct;
histogram Difference_Correct/normal;
run;
ODS graphics off;
proc univariate data=homework.vpp mu0=6;
var Difference_Correct;
run;
 
7 REPLIES 7
ballardw
Super User

Generally I adust colors and appearance with SAS code but you haven't shown any so it is hard to tell what may be appropriate.

 

The ODS Graphics statement options OUTPUTFMT controls the image type.

The specific option varies with the ods destination. For RTF use something like

 

ODS graphics/ outputfmt=EMF;

ods rtf file="path and file" <other destination options>;

<code to generate plots>

ods rtf close;

 

Html output by default should generate PNG files, likely in your work library location. Depending on where that is Excel may not find them as there are number of things going on singe images in HTML are displayed referenced files and depending on how you display the html in Excel it may not see the referenced location.

 

That error message looks like you aren't specifing where the output goes and is possibly attempting to write to a location on a server where you do not have access. But again without code it is hard to tell.

AsthmaticRunner
Calcite | Level 5

I updated it with the code.  Sorry about that.  I also tried doing the ODS graphics vice the ODS Excel to see if that would make a difference (it didn't).  

Reeza
Super User

There is a post on her from a day or two ago that explains this. It needs a workaround which may or may not work in SAS UE. 

Feel free to post your code and explain what youre trying to change and we can help you accomplish it via code. 

AsthmaticRunner
Calcite | Level 5

The code is now in the original respose.  I'm trying to edit/update both of the graphs. I want to take out the underscore in the labels (title and axis), I want to change the colors from the current baby blue to a dark blue with the curve being orange or yellow whichever looks better against the darker columns. 

 

 

Reeza
Super User

Apply labels to your variables to get the underscore removed.

 

ie

 

 

label my_variable = 'My Variable Name';

 

Unfortunately editing graphs from the procedures is not as straightforward. If you used SGPLOT it's ...

 

Instructions are here on how to create editable graphs are linked above. My computer is misbehaving and I can't post a direct link.

 

 

 

AsthmaticRunner
Calcite | Level 5

That changed the label on the axis, but not on the title? 

Reeza
Super User

Here's what I think the equivalent code would be for SGPLOT with examples of how you'd change the colors, labels and titles.

Note I used Hex codes to select the colours and in SAS you add CX in front. So get the hex colour you want and update the code as desired.

 

title 'My Histogram';
proc sgplot data=sashelp.class;
histogram height /  dataskin=none outline fill fillatrs=(color=CX00aad2);
density height / lineattrs=(color=Cxedb700) ;
label height='Height (inches)';
run;

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
  • 1548 views
  • 0 likes
  • 3 in conversation