gyli / PyWaffle

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

Allow for specification of just columns as well as just rows #16

Closed asongtoruin closed 4 years ago

asongtoruin commented 4 years ago

Hello again! Looks like you've been busy here, there's a lot that's been progressed since I last stuck my nose in.

Connected to my PR from before to add in a vertical parameter, I thought it might be useful to allow the user to specify just columns as well as just rows. I think this commit should cover it, though I'm not sure if you want me to add anything further for the docs (which I must say are looking real good right now)

If we take the absolute_block_numbers example, and change the code to be:

fig = plt.figure(FigureClass=Waffle, columns=7, vertical=True, values=data, legend={'loc': 'upper left', 'bbox_to_anchor': (1.1, 1)})

we get the following lovely tall boy:

image

What do you think?

gyli commented 4 years ago

Thanks for the PR!

I was thinking the user could figure their preferred columns/rows easily through some extra calculation. But since it's not complex to be implemented in the package, then why not to add it.

I will take care of the document later.