BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
jacko1801
Obsidian | Level 7

Hi. 

 

I am trying to just do a singular box plot for the data below - the box plot shows in the default colours but i want to change the blue of the box plot to pink, also i have seen elsewhere people have put a table inside the graph stating the quarters and the medium, how do i do that as well? 

 

here is my code:

PROC IMPORT 
  DATAFILE = '/home/imdb-videogames.csv'
  OUT = Videogame_data
  DBMS = CSV 
  REPLACE;
RUN;

DATA Videogame_data;
  SET Videogame_data;
  IF NOT MISSING(rating) AND NOT MISSING(votes) AND NOT MISSING(certificate);
RUN;

PROC SORT DATA=Videogame_data OUT=clean_videogamedata NODUPKEY;
  BY name;
RUN;

DATA Videogame_data;
  SET clean_videogamedata;
RUN;

DATA TITLES;
SET clean_videogamedata; 
words = COUNTW(name,' ');
RUN;

PROC PRINT DATA=TITLES;
VAR name words;
TITLE 'Number of Words in each Video Game Title';
RUN;

PROC MEANS DATA=TITLES NWAY NOPRINT;
VAR WORDS;
OUTPUT OUT = MEANS (DROP = _TYPE_ _FREQ_)
N = NUMBER_OF_OBSERVATIONS
MEAN = AVERAGE
;
RUN;

PROC PRINT DATA=MEANS NOOBS;
TITLE 'Average Number of Words Per Video Game Title';
RUN;

PROC sgplot DATA=TITLES;
vbox words; 
styleattrs datacolors=(pink) datacontrastcolors=(black);
run;

here is my outcome (statistically is fine - visually is not how i want it).  

 

Screenshot 2023-05-01 at 09.52.53.png

 

Thank you in advance for any help here 🙂 

 

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

See here :
SAS ODS Graphics: Procedures Guide
SGPLOT Procedure
https://go.documentation.sas.com/doc/en/pgmsascdc/v_031/grstatproc/n1waawwbez01ppn15dn9ehmxzihf.htm

 

PROC sgplot DATA=sashelp.heart;
 vbox Cholesterol / DATASKIN=GLOSS 
                    fillattrs=(color=lightgreen transparency=.2)
                    lineattrs=(pattern=dashdashdot color=pink thickness=4)
                    WHISKERATTRS=(pattern=solid color=pink thickness=7) 
                    DISPLAYSTATS=(Q1 MEDIAN Q3);
*styleattrs datacolors=(pink) datacontrastcolors=(black);
run;

 

Koen

View solution in original post

2 REPLIES 2
sbxkoenk
SAS Super FREQ

See here :
SAS ODS Graphics: Procedures Guide
SGPLOT Procedure
https://go.documentation.sas.com/doc/en/pgmsascdc/v_031/grstatproc/n1waawwbez01ppn15dn9ehmxzihf.htm

 

PROC sgplot DATA=sashelp.heart;
 vbox Cholesterol / DATASKIN=GLOSS 
                    fillattrs=(color=lightgreen transparency=.2)
                    lineattrs=(pattern=dashdashdot color=pink thickness=4)
                    WHISKERATTRS=(pattern=solid color=pink thickness=7) 
                    DISPLAYSTATS=(Q1 MEDIAN Q3);
*styleattrs datacolors=(pink) datacontrastcolors=(black);
run;

 

Koen

yabwon
Onyx | Level 15

Start with Maxim1 and do:

PROC sgplot DATA=sashelp.cars;
vbox invoice / 

FILLATTRS=(color=pink) 

LINEATTRS=(color=black thickness=2)  
MEANATTRS=(color=black )
MEDIANATTRS=(color=black)
WHISKERATTRS=(color=black thickness=2)
;
run;

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 630 views
  • 0 likes
  • 3 in conversation