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

FridayThe13th.png

 

Over on Twitter, Robert Allison reminds us today's a special day with his chart of 13 Years of Friday the 13th! So, to commemorate the occasion, here's a quick SAS ODS Graphics take on the box office hauls of the films in the Friday the 13th movie franchise, complete with a "slashed" (aka broken) y-axis.

 

SAS CODE

*==> Fun w/SAS ODS Graphics: Friday the 13th Movie Franchise Box Office (excludes 2009 "reboot")
     Movie poster images from Google search, Box office figures from Wikipedia; 

%let datasymbols=;                             * Map movies to their corresponding thumbnail movie poster images;
%macro gensymbols;
%do p=1 %to 11; 
  symbolimage name=symP%sysfunc(putn(&p,z2))                  /* Offset cropped images so tops approximate height */
              image="/folders/myfolders/Friday13th/%sysfunc(putn(&p,z2)).jpg" / voffset=-.5;
  %let datasymbols=&datasymbols symP%sysfunc(putn(&p,z2));
%end; 
%mend;

data movies;                                   * Create SAS dataset from inline data;
infile datalines dlm="|" dsd;
input title : $50. released : yymmdd10. boxoffice;
format released yymmdd10. boxoffice dollar6.2;
year=year(released);
x+1;                                           * Used to link box movie info to movie poster images;
datalines;
Friday the 13th|1980-05-09|59.75
Friday the 13th Part 2|1981-04-30|21.72
Friday the 13th Part III|1982-08-13|36.69
Friday the 13th: The Final Chapter|1984-04-13|32.98
Friday the 13th: A New Beginning|1985-03-22|21.93
Friday the 13th Part VI: Jason Lives|1986-08-01|19.47
Friday the 13th Part VII: The New Blood|1988-05-13|19.17
Friday the 13th Part VIII: Jason Takes Manhattan|1989-07-28|14.34
Jason Goes to Hell: The Final Friday|1993-08-13|15.94
Jason X|2002-04-26|16.96
Freddy vs. Jason|2003-08-15|114.9
;
                         * Create composite vbar/scatter plot (use movie poster images as markers);
ods listing gpath='/folders/myfolders';
ods graphics on / reset antialias width=10in height=8in attrpriority=none imagename="FridayThe13th";
proc sgplot data=Movies noborder noautolegend;
%gensymbols;
styleattrs datasymbols=(&datasymbols);
vbarbasic year / barwidth=.5 response=boxoffice nooutline fillattrs=(color=red) fill datalabel;
scatter x=year y=boxoffice /  group=x markerattrs=(size=75pt);
inset "Box Office (Millions)" / title=" Friday the 13th Movie Franchise " textattrs=(size=20pt) titleattrs=(size=26pt) position=top valuealign=center;
xaxis display=(nolabel noticks noline) type=discrete offsetmin=.05 offsetmax=.05; * "Slash" the y-axis (broken-axs);
yaxis display=(nolabel noticks) offsetmin=.001 offsetmax=.001 ranges=(0-62 100-117) grid tickvalueformat=dollar4.;

 

1 REPLY 1
ChrisHemedinger
Community Manager

giphy.gif

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

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!

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
  • 1 reply
  • 781 views
  • 3 likes
  • 2 in conversation