1

I want to create a chart that illustrates the count of a given binary variable using a single shape for each data point, and uses color to indicate if the value is 0 or 1.

The chart below shows an example similar to what I'm looking for. The only difference would be if any datapoints' "Success" value == 0, that point would be red, instead of green.

How might I most easily go about achieving this with Python? Is there a library with a turn-key solution for something like this? If not, how might I easily do this using Matplotlib?

enter image description here

Edit: I've found another example used in a more "scientific" context. It appears to be called a "Waffle Chart". It appears this might then be a duplicate question, as there's an answer here: How to do waffle charts in python? (square piechart)

enter image description here

Marcus Campbell
  • 2,746
  • 4
  • 22
  • 36
BirdLaw
  • 572
  • 6
  • 16
  • I'm not sure that Matplotlib can do something like this. What you're looking for seems to be a UI feature rather than some kind of scientific plot. – roganjosh Dec 13 '17 at 17:34
  • Nice find in the edit! – roganjosh Dec 13 '17 at 17:43
  • 1
    If I vote to close this as a duplicate I think you are able to accept that automatically. That's if you want this closed as a dupe, which you seem to be suggesting in the edit. It's up to you since I don't know whether that question actually does what you want specifically. – roganjosh Dec 13 '17 at 17:45
  • I think the intention in the edit is clearly to mark this as duplicate. I just did so. In case there is some need for further clarification you may of course ask to reopen it. – ImportanceOfBeingErnest Dec 13 '17 at 23:13

0 Answers0