-
Notifications
You must be signed in to change notification settings - Fork 618
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
Adding setter for colorbar's label_str #1292
Changes from 2 commits
b273d58
a4dbf05
bb774cf
d2d03e9
9e56b9a
47060e4
f15ca6f
6030a92
939917d
59a9d18
0bf9f72
53b5114
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 |
---|---|---|
|
@@ -132,6 +132,15 @@ def label(self): | |
def label(self, label): | ||
self._colorbar.label = label | ||
|
||
@property | ||
def label_str(self): | ||
return self._colorbar._label_str | ||
|
||
@label_str.setter | ||
def label_str(self, label_str): | ||
self._label_str = label_str | ||
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. Please change this also to 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. Will do as soon as I can. |
||
self._update() | ||
|
||
@property | ||
def clim(self): | ||
return self._colorbar.clim | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -596,6 +596,15 @@ def label(self, label): | |
self._label = label | ||
self._update() | ||
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'm not sure why it took me this wrong to realize this, but why can't all of this be done with an
I'm not sure if the Thoughts? 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. @djhoese 👍 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 was using this code here https://github.com/macrocosme/shwirl/blob/master/shwirl/extern/vispy/scene/widgets/colorbar.py without a fuss. But I should indeed sit down and properly test this. I'm travelling so it may be a few days. Edit: I'm finally working on the clean-up. I realised I have had modified Nevertheless, I think the using 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. As to merging the two with an if, I like it! 👍 |
||
|
||
@property | ||
def label_str(self): | ||
return self._label_str | ||
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. Same here, add short docstring with description. 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. Docstrings finally added. Sorry for the wait! |
||
|
||
@label_str.setter | ||
def label_str(self, label_str): | ||
self._label_str = label_str | ||
self._update() | ||
|
||
@property | ||
def ticks(self): | ||
""" The vispy.visuals.TextVisual associated with the ticks | ||
|
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.
@macrocosme You also need to do this change in the
setter
.