Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to arrange the filling order as from top to bottom when using new-line? #22

Closed
ReichYang opened this issue Sep 28, 2021 · 1 comment
Labels

Comments

@ReichYang
Copy link

Hi. I want to use the new-line arrangement for my plot.

This is what's shown in the documentation.

fig = plt.figure(
FigureClass=Waffle,
columns=10,
values=[30, 16, 4],
block_arranging_style='new-line',
vertical=True
)

image

However, as you can see, for the orange ones, if they have to span multiple rows and cannot span multiple rows, the plot will try to fill out the last row first, leaving the top row of the category incomplete. Is there a way to reverse it so that within each category, the top rows get filled out first then the bottom rows and if multiple rows cannot be filled the last row will be incomplete instead of the first row.

@gyli
Copy link
Owner

gyli commented Sep 29, 2021

Hi! By default it is plotting each category from bottom left to top right, that's why you are seeing [30, 16, 4] in bottom to top direction. So to make the tail blocks at the "last rows" (top to bottom direction), you can simply flip the plot by specifying starting_location='NW'.

fig = plt.figure(
FigureClass=Waffle,
columns=10,
values=[30, 16, 4],
block_arranging_style='new-line',
vertical=True,
starting_location='NW'
)

This section might be helpful: https://pywaffle.readthedocs.io/en/latest/examples/block_shape_spacing_location_direction_and_style.html#where-to-start-first-block

@gyli gyli closed this as completed Dec 17, 2021
@gyli gyli added the wontfix label Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants