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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 833 views
  • 10 likes
  • 3 in conversation