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

Flag of France - Take 3!Flag of France - Take 3!

 

A quick SAS ODS Graphics take on the Flag of France for Bastille Day - third time's the charm!

 

* Fun With SAS ODS Graphics: Happy Ba(r)stille Day! (vertical bar chart Flag of France)
  Based on colors/dimensions at en.wikipedia.org/wiki/Flag_of_France;

data flag; do c=1 to 3; output; end;                                     * Generate flag data - tricolour of blue/white/red;

ods graphics / reset height=4in width=6in antialias;                     * 2:3 proportion (height:width);

proc sgplot data=flag;                                                   * Plot #1: Generate bar chart;
vbar c;

proc sgplot data=flag;                                                   * Plot #2: Generate bar chart with colors of Flag of France;
vbar c / colorresponse=c colormodel=(cx0055A4 cxFFFFFF cxEF4135);

proc sgplot data=flag aspect=.66667 noautolegend pad=0 noborder nowall;  * Plot #3: Generate bar chart as tricolour Flag of France;
vbar c / barwidth=1 colorresponse=c colormodel=(cx0055A4 cxFFFFFF cxEF4135) nooutline baselineattrs=(thickness=0);
xaxis display=none min=.5 max=3.5 offsetmin=0 offsetmax=0 type=linear;   * Suppress axis/padding;
yaxis display=none min=0 max=1 offsetmin=0 offsetmax=0;
run;

Flag of France - Take 1!Flag of France - Take 1!Flag of France - Take 2!Flag of France - Take 2!

2 REPLIES 2
Ksharp
Super User

@tc

 

BLOCK also can do this simple .

 


data flag; do c=1 to 3; output; end; run;                                    * Generate flag data - tricolour of blue/white/red;

ods graphics / reset height=4in width=6in antialias noborder;                     * 2:3 proportion (height:width);

proc sgplot data=flag noautolegend; * Plot #1: Generate bar chart;
styleattrs datacolors=(cx0055A4 cxFFFFFF cxEF4135);
block x=c block=c/novalues nooutline  ;
xaxis type=discrete integer display=none   offsetmax=0.17 offsetmin=0.17;
yaxis display=none;
run;

Ksharp_0-1626268179787.png

 

GraphGuy
Meteorite | Level 14

@Ksharp - an elegant solution ... but it takes the 'bar' out of Ba(r)stille day! 🙂

 

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 2 replies
  • 1040 views
  • 10 likes
  • 3 in conversation