UCL / TLOmodel

Epidemiology modelling framework for the Thanzi la Onse project
https://www.tlomodel.org/
MIT License
11 stars 5 forks source link

Crowded x-axis when plotting pandas bar plots #1047

Open mnjowe opened 1 year ago

mnjowe commented 1 year ago

When plotting bar plots using df.plot.bar(), Pandas assumes that each bar in a bar plot deserves its own label hence causing x-axis to be crowded when plotting for a long simulation. I have dealt with this issue before in lifestyle by using an accepted solution in stackoverflow here but I was wondering if we can have like a helper function in TLO that everyone can use when in a similar situation?

tbhallett commented 1 year ago

Thanks @mnjowe -- very good point.

If you'd like to propose a utility function based on what you did and raise a PR, that would be great. What do you think?

I've added it to our list of issues to do anyway.

mnjowe commented 1 year ago

Thanks Tim, that's a great idea too. I will see how best I can modify the function to make it fit a utility function and yes, a PR will be opened once I've started working on it.

On Tue, Aug 1, 2023, 10:23 AM Tim Hallett @.***> wrote:

Thanks @mnjowe https://github.com/mnjowe -- very good point.

If you'd like to propose a utility function based on what you did and raise a PR, that would be great. What do you think?

I've added it to our list of issues to do anyway.

— Reply to this email directly, view it on GitHub https://github.com/UCL/TLOmodel/issues/1047#issuecomment-1659816469, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXJ7BUIPDGUEJCEPH62GHTXTC4JNANCNFSM6AAAAAA25344NQ . You are receiving this because you were mentioned.Message ID: @.***>