-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fixed matplotlib fatbands and enabled opacity #862
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #862 +/- ##
==========================================
- Coverage 86.98% 86.98% -0.01%
==========================================
Files 403 403
Lines 52552 52559 +7
==========================================
+ Hits 45712 45717 +5
- Misses 6840 6842 +2 ☔ View full report in Codecov by Sentry. |
@@ -380,6 +381,8 @@ def draw_multisize_line( | |||
# Set the values used for colormapping | |||
lc.set_linewidth(line.get("width", 1)) | |||
lc.set_linestyle(self._plotly_dash_to_matplotlib(line.get("dash", "solid"))) | |||
lc.set_color(line.get("color")) | |||
lc.set_alpha(line.get("opacity")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit pedantic here, but matplotlib users are used to using alpha=
, could it allow both things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would become a complete chaos if I try to support all keywords of all backends 😅
I took the decision to stick to plotly terminology in general to make things easier to maintain and document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, fair...
@@ -380,6 +381,8 @@ def draw_multisize_line( | |||
# Set the values used for colormapping | |||
lc.set_linewidth(line.get("width", 1)) | |||
lc.set_linestyle(self._plotly_dash_to_matplotlib(line.get("dash", "solid"))) | |||
lc.set_color(line.get("color")) | |||
lc.set_alpha(line.get("opacity")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, fair...
#790 had not been fully fixed by #799. There were some bugs regarding
fatbands_mode="scatter"
andfatbands_mode="line"
for the matplotlib backend.Also enabled the possibility to use
"opacity"
for all variants of fatbands, to avoid some fatbands getting hidden by the overlap with the next ones.With the example that @rreho provided using "scatter" "and matplotlib", and setting
"opacity": 0.2
for the red fatbands: