Skip to content
Advertisement

How to specify the color for a partial histogram patch

  • I would like to produce the following graph
    • Note that one bar is partially blue and partially teal. This is what I’m trying to reproduce

enter image description here

JavaScript
  • Rectangle(xy=(0.876747, 0), width=0.408487, height=0.206371, angle=0) is the Rectangle that needs to be partially colored.
    • Rectangle(xy=(1.28523, 0), width=0.408487, height=0.150066, angle=0) is the patch immediately after, which is colored Teal

Plot generated by my code

  • Note the partial bar, beginning at the mean, is not teal

enter image description here

Advertisement

Answer

JavaScript

This adds the bar in a matching manner. A bit hacky as we said before. enter image description here

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement