Skip to content

fix!(postproc/routines): label & marker customisation possible

Arin Wongprommoon requested to merge issue-034 into master

WHY IS THIS CHANGE NEEDED?:

  • heatmap routine hard-codes y-label and colour bar labels; single_(birth_)_plot routine hard-codes y-label. doesn't allow the user to change them unless the user imports the plotter object and modifies the relevant attributes internally. this isn't user-friendly
  • useful to highlight individual points especially with low resolution time series

HOW DOES THE CHANGE SOLVE THE PROBLEM?:

  • added new ylabel and cbarlabel arguments to the relevant plotter objects and used them to define attributes rather than setting the values of the attributes to certain strings. this is the same design other routines, most importantly mean/median_plot. defined defaults in the corresponding plotting functions
  • add mean/median_marker argument to plotter object and create attribute correspondingly. link this argument to matplotlib marker argument -- user can then use whatever marker argument they need, e.g. 'o' for circle dots

WHAT SIDE EFFECTS DOES THIS CHANGE HAVE?:

  • if a user script uses heatmap or single_(birth_)plot, some labels will change. however, the user can easily change the labels to their liking by defining the ylabel and cbarlabel (for heatmap) arguments.
  • tech debt: repetitive code across routines, could be improved with inheritance or decorators. a project for another time...

EVIDENCE THAT COMMIT WORKS:

  • tried it on a random dataframe -- able to change labels and customise markers

REFERENCES:

NOTE: Decided to put two issues on the same branch and merge request because they both change plotting routines and thus are limited in their scope to destroy other things. It also should make the reviewer's life easier and makes reviewing faster.

Merge request reports