Added plot style context managers to all plot methods#208
Added plot style context managers to all plot methods#208jamesramsden-bh merged 16 commits intodevelopfrom
Conversation
…ot with matplotlib
6ab9999 to
c387559
Compare
|
@BHoMBot check installer |
|
@Tom-Kingstone to confirm, the following actions are now queued:
|
|
@Tom-Kingstone just to let you know, I have provided a |
|
@Tom-Kingstone to confirm, the following actions are now queued:
|
|
@Tom-Kingstone to confirm, the following actions are now queued:
|
jamesramsden-bh
left a comment
There was a problem hiding this comment.
Have tested with run_tests.bat and a manual spot check, happy to merge
|
@BHoMBot check ready-to-merge |
|
@jamesramsden-bh to confirm, the following actions are now queued:
|
|
@BHoMBot check ready-to-merge |
|
@Tom-Kingstone to confirm, the following actions are now queued:
|
|
@BHoMBot check ready-to-merge |
|
@Tom-Kingstone to confirm, the following actions are now queued:
|
NOTE: Depends on
Issues addressed by this PR
Closes #204
Closes #207
This removes the need to globally set plot style in dependent packages (see this PR for example), and allows setting it dynamically on method call using the kwarg "style_context". By default all the plot methods will use "python_toolkit.bhom" as the plot style, but this can be overridden by passing "default" to instead use whatever default matplotlib has currently set.
Moved the mplstyle files to the root of the package just to allow easy selection in code (allows passing "python_toolkit.bhom" instead of the path to the .mplstyle file)
Also added a dark theme (much to the benefit of my eyes on dark backgrounds) called bhom_dark.
This only works for matplotlib based plots, so plotly plots (like parallel_coordinate_plot) do not allow this.
Also @Felix-Mallinder bug fixes from #207
Test files
Run the unit tests and ensure they pass, see it in action by using any of the matplotlib based plot methods (eg. heatmap) and passing
style_context="python_toolkit.bhom"to the method.Changelog
style_contextkwarg for all matplotlib plot methodsAdditional comments
packages that depend on python_toolkit must change any references to the
python_toolkit/bhom/bhom.mplstylefile topython_toolkit/bhom.mplstyleor more cleanly with matplotlib, use"python_toolkit.bhom"