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

Fractional blocks #26

Open
riley-x opened this issue Jan 30, 2022 · 1 comment
Open

Fractional blocks #26

riley-x opened this issue Jan 30, 2022 · 1 comment

Comments

@riley-x
Copy link

riley-x commented Jan 30, 2022

Is there a way to enable fractional blocks, so that there is no rounding? I'm especially running into issues where the rounding causes the total number of blocks to fluctuate, as in the example below. Both datasets total to 87.46 but the top plot has an extra block. It'd be great if the last block could have fractional size, and if the intermediate blocks could have split colors.

output

Code to reproduce:

plot1 = {'Net income': 18.46, 'Income tax': 1.64, 'MG&A': 7.52, 'R&D': 15.3, 'Cost of sales': 44.54}
plot2 = {'Misc income': 1.2, 'Revenue': 86.26}
fig = plt.figure(
    FigureClass=Waffle,
    plots={
        311: {'values':plot1},
        312: {'values':plot2}
    },
    rows=5,
    figsize=(9, 7),
    legend={'loc': 'upper left', 'bbox_to_anchor': (1.1, 1)},
    block_arranging_style='snake',
)
@gyli
Copy link
Owner

gyli commented Jan 30, 2022

Hi @riley-x , thank you for submitting this feature. I believe it's a cool feature and also quite feasible. My only concern is it might require some trick to support fractional icon, but it could be added after the fractional blocks implementation anyways I guess.
Stay tuned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants