Announcement

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

  • Two overlaid bars, put larger bar in background, smaller in f

    Good morning!
    I want to plot two numeric variables as bars on another numeric variable. I adjusted the bar width and the transparency, and the result looks like this:
    Click image for larger version

Name:	statalist.JPG
Views:	1
Size:	60.0 KB
ID:	1657330

    I would like to show the (absolute) smaller bar for each x-value in front of the other bar.
    Is there an option I miss?

    Best
    Andreas

  • #2
    You're not missing an option I know about. You could always work with

    Code:
    gen barmin = cond(abs(var1) < abs(var2), var1, var2) 
    
    gen barmax = cond(abs(var1) < abs(var2), var2, var1)
    but then the colour coding wouldn't make much sense,

    Wouldn't a line chart be clearer?

    Comment


    • #3
      Thanks, Nick.

      I use the graph to explain my economic experiment. My subjects will be setting prices. And the possible prices are discrete.
      The colors should stay the way they are. I use line charts when I explain the theory (where we assume continuous prices) and I
      want to contrast theory and experimental design.

      I will just stick with the transparent bars.

      Best
      Andreas

      Comment

      Working...
      X