Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • bar charts

    Hello everyone,

    I need help on how to fill inside a bar chart with different shapes (not colors)? (e.g. shaded area, dotted area etc.)

    Many thanks in advance

  • #2
    Stata isn't very supportive of uneven shadings, whether stripes, stipples or something else. A while back Sergiy Radyakin did some work on that. I don't know the present status of his work.

    The context for such occasional questions is usually that using different colours is out of the question, so you want some other way of distinguishing categories or variables, to which the answer you don't want is do you really need that? It is a lousy publication that doesn't support different grey scales, and in any case different axis labels can carry the crucial information.

    Comment


    • #3
      A while back Sergiy Radyakin did some work on that. I don't know the present status of his work.
      As of version 17 of Stata the command twoway parea remains operational:

      Code:
      ssc install twoway_parea
      sysuse sp500, clear
      twoway parea high date, pattern(pattern8) || parea low date, pattern(pattern6) scale(0.5)
      Click image for larger version

Name:	twoway_parea_radyakin.png
Views:	1
Size:	79.3 KB
ID:	1698488


      Comment


      • #4
        Sergiy Radyakin Thanks for the update. What would be your advice for someone wanting shaded or stippled bars?

        Comment


        • #5
          The package twoway_parea was written to solve a very particular task - drawing patterned maps, for that it worked well. Other twoway graph types are not affected.

          To the extent that it is possible to reduce that chart type to area charts, that can be done and then twoway_parea be used for drawing. Most users will find it too high of an effort, and I agree.

          A better approach would be to write a similar wrapper for the twoway bar command. That would require some coding and some testing. There is hardly any demand for that in my present projects, but if it comes to implementation, I'll do the effort to get it out via SSC, GitHub or similar.

          Is there any recurring interest in this? I imagine this is fading away with advances and reductions of costs in color printing, and more importantly in switching to online/electronic publications, rather than actual printing on actual paper.

          Comment


          • #6
            Sergiy Radyakin Clearly it is hard -- indeed impossible -- to know how many people wanted this, but gave up trying in Stata because they couldn't find out how to do it. That said, an impression from Statalist is that queries like this post are now rare.

            A pivot for many people in this field was Edward Tufte's 1983 book The Visual Display of Quantitative Information which was severe on such fill patterns, with reasons and horrible examples. A version of this argument runs

            1. Separate patterns or colours are not needed for single bars. If you use one colour, you don't need a legend. It is the text labels that should carry the information any way.

            2. If you need to distinguish bars, say that you are stacking bars, or wish to emphasise one bar, most people are able to use different colours, so different fill patterns aren't needed.

            3. If you are printing or displaying without access to a full range of colours, consider using different shades of grey.

            4. If your design relies greatly on different colours, think about using a different design any way. Stacking isn't the only choice even for two-way classifications.

            That's a fairly extreme point of view (mine, and possibly that of some readers too) but the points are best discussed with data examples in view. I would always prefer someone to say "I am using this design because it works better than others" rather than their feeling that some self-designated authority has called them out for flouting someone else's design rules.

            Comment

            Working...
            X