CityofToronto / bdit_plotting_gallery

A gallery of static Python plots that the Big Data Innovation Team has produced
GNU General Public License v3.0
1 stars 0 forks source link

Restructure multiline and grouped bar chart functions #20

Closed MelinaGoula closed 4 months ago

MelinaGoula commented 8 months ago

Functions to review:

MelinaGoula commented 7 months ago

Comparison of stacked bar chart functions

Previous (stacked_chart) sphx_glr_plot_grouped_bar_rick_001 Rewrite (horizontal_grouped_bar_chart) sphx_glr_plot_grouped_bar_rick_002 Example of (vertical_grouped_bar_chart) sphx_glr_plot_grouped_bar_rick_003

MelinaGoula commented 7 months ago

Functionality that was not carried over from multi_linechart to multi_linechart_test (the temporary new version):

Example plot with multi_linechart showing a lot of the functionality sphx_glr_plot_multiline_003

Recreated with multi_linechart_test: sphx_glr_plot_multiline_002 I am not sure how to deal with legend placement in cases like this where there is not a lot of free space. One alternative is to follow the previous format of having multiple columns in the legend which would look like this: sphx_glr_plot_multiline_002

gabrielwol commented 7 months ago

I am not sure how to deal with legend placement in cases like this where there is not a lot of free space. One alternative is to follow the previous format of having multiple columns in the legend which would look like this:

Have you considered having the legend always outside the plot? This could help with consistency no matter the data being plotted!

gabrielwol commented 7 months ago

Functionality that was not carried over from multi_linechart to multi_linechart_test (the temporary new version): .... Recreated with multi_linechart_test: 302367434-a85466f0-fda7-46b1-983d-2c67ca25f31e

I think the ticks would be an important feature for this graph type which we often use for timeseries. In our demos people are always trying to pinpoint the specific date that graphed events happen. Maybe dark ticks for the labelled points and lighter ticks for the others as a default?

gabrielwol commented 7 months ago

@MelinaGoula your 3 new charting functions are very elegant compared with the old versions, well done! See a few comments above.

MelinaGoula commented 6 months ago

I have made the following changes and I think this is ready for re-review:

One thing I think can be done in the future to improve the code structure is to not have as many function parameters passed in the helper functions, but this can be probably only be done by refactoring the code.