-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
add scatter3d docs and fix colorbar title #5418
Changes from 5 commits
e46773b
cfdb7ca
20d9487
1f0bd42
7be6589
71f1db9
13b853a
ddf7196
ffc73b7
1918c2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -603,11 +603,19 @@ def get_color_opts(self, eldim, element, ranges, style): | |
opts = {} | ||
dim_name = dim_range_key(eldim) | ||
if self.colorbar: | ||
if isinstance(eldim, dim): | ||
title = str(eldim) if eldim.ops else str(eldim)[1:-1] | ||
else: | ||
title = eldim.pprint_label | ||
opts['colorbar'] = dict(title=title, **self.colorbar_opts) | ||
opts['colorbar'] = dict(**self.colorbar_opts) | ||
if not "title" in opts['colorbar']: | ||
if isinstance(eldim, dim): | ||
title = str(eldim) | ||
if eldim.ops: | ||
title = title | ||
elif title.startswith("dim('") and title.endswith("')"): | ||
title = title[5:-2] | ||
else: | ||
title = title[1:-1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know why title[1:-1] is a valid value from time to time. But it was there before my time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably because of something like this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's pretty strange! |
||
else: | ||
title = eldim.pprint_label | ||
opts['colorbar']['title']=title | ||
opts['showscale'] = True | ||
else: | ||
opts['showscale'] = False | ||
|
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.
Previously I have put code blocks into
>>>
lines. But they are hard to copy and use directly. VS Code actually renders.. code-block::
nicely. So this is better to use.