BookmarkSubscribeRSS Feed
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10

MJ - Game Highs by Season - Take 2!MJ - Game Highs by Season - Take 2!

 

A stacked bar chart reminder that The Last Dance debuts tonight!

 

*==> Fun w/SAS ODS Graphics: Michael Jordan - Total Points Game Highs by Season;

data MjSeasonHighsGames (keep=Season seg pts);
infile datalines firstobs=2;
input Season : $ threes twos ones pts;
retain seg 0;                                         
pts=3; do i=1 to threes; seg+1; output; end;  * Generate one bar segment for each score (scaled by # points);
pts=2; do i=1 to twos;   seg+1; output; end; 
pts=1; do i=1 to ones;   seg+1; output; end;  * Data from basketball-reference.com;
datalines; 
Season 3P 2P FT PTS
1984-85 0 19 11 49
1985-86 0 9 15 33
1986-87 0 22 17 61
1987-88 0 21 17 59
1988-89 0 20 13 53
1989-90 2 21 21 69
1990-91 0 17 12 46
1991-92 1 18 12 51
1992-93 1 26 9 64
1994-95 3 18 10 55
1995-96 2 19 9 53
1996-97 5 13 10 51
1997-98 0 18 13 49
2001-02 0 21 9 51
2002-03 0 18 9 45
;
ods graphics / width=8in height=5in;
proc sgplot noautolegend;                      * Stacked bar chart showing individual 3P/2P/FG scores;
Title  "MICHAEL JORDAN - GAME HIGHS BY SEASON";
hbar season / response=pts group=seg fill colorresponse=pts colormodel=(red green blue) seglabel 
              seglabelattrs=(color=white weight=bold) datalabel outline outlineattrs=(color=white);
xaxis display=(nolabel) grid;
yaxis display=(nolabel);
footnote "Source: basketball-reference.com/players/j/jordami01.html#all_year-and-career-highs";
run;
4 REPLIES 4
PaigeMiller
Diamond | Level 26

Explain the plot, please!

--
Paige Miller
DanH_sas
SAS Super FREQ

The bar height represents the season high score. The segments represent the combination of 3-point, 2-point, and 1-point (free throws) that got him that score.

PaigeMiller
Diamond | Level 26

Thank you, now it makes sense.

 

May I suggest an improvement to the plot?

 

In my opinion, it is a cardinal sin of graphical methods not to label axes and to not indicate what variable is being plotted, even when it seems obvious, as in the case of the vertical axis. Also, the variable being plotted "points" or "points scored" is missing and should be in the title and as the label of the horizontal axis, and is a partial cause of my confusion upon initially viewing the plot. 

 

Lastly, not a serious matter, but perhaps breaks in the vertical axis would help to indicate years when Mr. Jordan was "retired" and/or playing baseball.

--
Paige Miller
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10
All fair points - sometimes I try to conserve graph "real estate" at the cost of explainability. And I guess this would be about as good a place as any for a "broken" axis!

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1308 views
  • 4 likes
  • 3 in conversation