gyli / PyWaffle

🧇 Make Waffle Charts in Python.
MIT License
578 stars 105 forks source link

Vertical orientation? #12

Closed asongtoruin closed 4 years ago

asongtoruin commented 4 years ago

It would be interesting to be able to generate plots that were vertically orientated - i.e. rather than drawing the blocks column by column, they could be drawn row by row. I've got a basic working attempt at asongtoruin/pywaffle@e4d73b7 which adds the extra boolean kwarg vertical to do this, but I wasn't sure if this was functionality you think would be useful for the module.

For example, if we take the basic example from the examples folder: fig = plt.figure(FigureClass=Waffle, rows=5, columns=10, values=[48, 46, 3]) this produces the following horizontal plot: basic_horiz

If we change this to fig = plt.figure(FigureClass=Waffle, rows=10, columns=5, values=[48, 46, 3], vertical=True) we instead get a vertically oriented plot:

basic

Thoughts?

gyli commented 4 years ago

Nice work. This is definitely something useful. Please feel free to submit a PR and we can test whether it works well with other parameters.