BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I've got a report (stacked bar chart) that is finished except they don't like the patterns. The charts look great except the patterns are hard to distinguish especially when printed in black and white.

I'm currently using the standard L1-L5, R1-R5, X1-X5 but it looks like other patterns may be available. However, I've not been able to correctly specify anything except the standard patterns.

Can anyone point me to how to set the value= part of the pattern giving more patterns?
10 REPLIES 10
GraphGuy
Meteorite | Level 14
I think the L (left), R (right), and X (cross-hatch) patterns are the only ones, besides solid ones (using colors, or shades of gray).

One other possibility - if you have various pattern samples in an image file,
you could use that image as the fill pattern (assuming it's a 2d bar chart,
not a 3d one ... and maybe a few more limitations & gotchas).


The pattern statement would be something like the following (the color only comes into play, if the image file can't be found)...

pattern1 color=blue v=s image='random_pattern.gif' imagestyle=tile;
Bill
Quartz | Level 8
Given the difficulty of reading / interpreting the stacked bar (an inherent stacked bar problem), you might want to consider small multiples of unstacked bars. You will likely improve the readability quite considerably. Here's a link to an example of small multiples: http://www.robslink.com/SAS/democd15/scen3b.htm
deleted_user
Not applicable
the problem is unstacking the bars makes comparisons more difficult.

this is an analysis of a survey so each bar represents either a different question or group of respondents. Using a stacked bar allows me to compare percentages of different answers. For example, all negative answers are colored red from left to right with most negative on the far left and least negative on the right, then the positive answers are colored green with most positive on the far right and least positive on the left and a neutral answer in the center. This arrangement allows the viewer to quickly compare questions and groups and quickly focus in on problems
Bill
Quartz | Level 8
So the bars run from say -5 to +5 and each value has a frequency attached to it? Can you share the numbers for 2 or 3 bars?
deleted_user
Not applicable
what I plot in the stacked bar is the cumulative percent in a horizontal bar chart so if the 20% gave each answer of a 5 part question the first section would run from 0 to 20, the second 20 to 40 and then 60 - 80 etc until 100 percent was reached.
Bill
Quartz | Level 8
Bill;

If I understand your situation somewhat, I think that your data and display is something similar to the first hbar line below. The second hbar produces a display that facilitates a more direct comparison of the response rate of the various answers. But maybe I misunderstand!

data QandA;
input q a pct;
datalines;
1 1 20
1 2 20
1 3 20
1 4 20
1 5 20
2 1 15
2 2 25
2 3 10
2 4 42
2 5 08
3 1 12
3 2 30
3 3 17
3 4 18
3 5 23
;
run;

proc gchart data=QandA;
hbar q/discrete
subgroup=a
sumvar=pct;
run;

hbar a/discrete
group=q
sumvar=pct;
run;
deleted_user
Not applicable
your correct

the problem is that when a non-color copy is made of a chart, solid colors are often impossible to distinguish. As a result I different hash patterns. However, when some of the segments are very small the hash patterns become difficult also. Therefore, I'm wanting a greater selection of hash patterns.
GraphGuy
Meteorite | Level 14
Several years ago I put in a request/suggestion for some new/additional patterns, with varying densities of dots (request S0227341), but the idea got shot down.

If Tech Support hears more users needing/requesting such a feature (new dot-patterns, or other/more patterns), this will help increase the likelihood of such enhancements being added! 🙂
deleted_user
Not applicable
I debate creating a bunch of pattern like images and using them.

Or maybe someone out there has already done this? All you might do is find patterns available in other apps either print them or use copy and paste in a photo editor. I personally don't have the time
Bill
Quartz | Level 8
Bill K;

You are most correct - colour printing to b/w is a challenge. Few colours are b/w compliant and quite specific ones at that. I've found www.colorbrewer2.org to be very helpful for choosing colours that are print, screen, projector and colour blind compliant.
The snippet of code below should serve as a prototype to display your data in a meaningful way with individual and cumulative values - based on the data generated in an earlier response - without the need to resort to a lot of patterns or colours.

proc gchart data=QandA;

hbar a/discrete
group=q
freq=pct g100 cfreq;

Hope this helps,
Bill

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