How can I find out what attributes (thickness/color/pattern) are used for default axis gridlines in proc sgplot?
Using "prog sgplot", I specify grid option for yaxis as follows:
proc sgplot data=xxx;
....
yaxis label="Percent" values=(0 to 0.2 by 0.05) grid;
Now, I am creating a graph template and want to have the same gridlines that sgplot uses by default. But I need to specify the attributes (thickness/color/pattern) and I don't know what they are or how to find them.
proc template;
list styles; /* list available styles;*/
source styles.htmlblue; /* contents of htmlblue style*/
source styles.statistical; /* contents of statistical style
where you will find reference to styles for grid lines and background */
run;
The default gridline attributes come from the GraphGridLines style element in the active ODS style.
proc template;
list styles; /* list available styles;*/
source styles.htmlblue; /* contents of htmlblue style*/
source styles.statistical; /* contents of statistical style
where you will find reference to styles for grid lines and background */
run;
Thank you ghosh for this super helpful reply.
For anyone with a similar issue this is a great tip sheet also
https://support.sas.com/rnd/app/ODSGraphics/TipSheet_GraphStyle.pdf
It addressed 2 related issues I was having, 1) I didn't know what style sheet I was using with sgplot; and 2) the info I needed was in the "parent" style not the style I was using
proc template;
source styles.pearl / expand;*style & parents;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.