-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Offset and scaling factors in axis format #4376 #6086
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
Changes from 1 commit
137c7aa
ab1b3a2
4079e1a
bfc7389
09f800c
02f0a11
5368336
fee8ab9
681820f
66061ad
53ed618
4c86635
9ce9d3c
8d9d121
2737c5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -446,11 +446,21 @@ def get_useScalingFactor(self): | |
|
|
||
| def set_useScalingFactor(self,val): | ||
| """ | ||
| Takes (True|False|numeric value) as argument. | ||
| Enable, disable, or sets and enables the use of scaling factor | ||
| in the axis. | ||
| Control and set the scaling factor. Disabling this returns the | ||
| formatter to its default behavior, e.g. it will try to find | ||
| an appropriate scaling/offset if enabled. | ||
| Note that either offset or scaling can be used. Therefore, | ||
| this automatically turns off offset | ||
|
|
||
| Parameters | ||
| ---------- | ||
| val : (True|False|numeric) | ||
| Enable, disable, or sets and enables the use of scaling factor | ||
| in the axis. | ||
|
|
||
| Returns | ||
| ------- | ||
| NONE | ||
| """ | ||
|
|
||
| if val in [True, False]: | ||
|
|
@@ -471,11 +481,21 @@ def get_useOffset(self): | |
|
|
||
| def set_useOffset(self, val): | ||
| """ | ||
| Takes (True|False|numeric value) as argument. | ||
| Enable, disable, or sets and enables the use of an offset | ||
| in the axis. | ||
| Control and set the offset. Disabling this returns the | ||
| formatter to its default behavior, e.g. it will try to find | ||
| an appropriate scaling/offset if enabled. | ||
| Note that either offset or scaling can be used. Therefore, | ||
| this automatically turns off scaling factor | ||
| this automatically turns off scaling | ||
|
|
||
| Parameters | ||
| ---------- | ||
| val : (True|False|numeric) | ||
| Enable, disable, or sets and enables the use of an offset | ||
| in the axis. | ||
|
|
||
| Returns | ||
| ------- | ||
| NONE | ||
| """ | ||
| if val in [True, False]: | ||
| self.offsetval = 0 | ||
|
|
@@ -518,20 +538,39 @@ def __call__(self, x, pos=None): | |
| return self.fix_minus(s) | ||
|
|
||
| def set_scientific(self, b): | ||
| '''True or False to turn scientific notation on or off | ||
| """ | ||
| Enable/disable scientific notation | ||
| see also :meth:`set_powerlimits` | ||
| ''' | ||
|
|
||
| Parameters | ||
| ---------- | ||
| b : (True|False) | ||
|
Member
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. just
Author
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. Done |
||
| Enable, disable scientific notation | ||
|
|
||
| Returns | ||
| ------- | ||
| NONE | ||
| """ | ||
| self._scientific = bool(b) | ||
|
|
||
| def set_powerlimits(self, lims): | ||
| ''' | ||
| """ | ||
| Sets size thresholds for scientific notation. | ||
|
|
||
| e.g., ``formatter.set_powerlimits((-3, 4))`` sets the pre-2007 default | ||
| in which scientific notation is used for numbers less than 1e-3 or | ||
| greater than 1e4. | ||
| See also :meth:`set_scientific`. | ||
| ''' | ||
|
|
||
| Parameters | ||
| ---------- | ||
| lims : (number,number) | ||
| tuple with upper and lower limit triggering scientific notation | ||
|
|
||
| Returns | ||
| ------- | ||
| NONE | ||
| """ | ||
|
|
||
| if len(lims) != 2: | ||
| raise ValueError("'lims' must be a sequence of length 2") | ||
| self._powerlimits = lims | ||
|
|
@@ -554,7 +593,20 @@ def format_data(self, value): | |
|
|
||
|
|
||
| def get_offset(self): | ||
| """Return scientific notation, plus offset""" | ||
| """ | ||
| Returns a string with the offset(or scientific notation)/scaling | ||
| factor which is properly formatted. This is used as additional text | ||
| next to the ticks. | ||
|
|
||
| Parameters | ||
|
Member
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. Do not include unneeded sections.
Author
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 am not sure if you mean (1) leave it as it was or (2) no documentation needed for this method as a user will probably not use this method. Which one do you prefer?
Member
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. The rest of the docstring is good, just do not include the |
||
| ---------- | ||
| NONE | ||
|
|
||
| Returns | ||
| ------- | ||
| :string | ||
|
Member
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. no |
||
| """ | ||
|
|
||
| if len(self.locs) == 0: | ||
| return '' | ||
| s = '' | ||
|
|
||
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.
val : bool or scalerI think in the right numpydoc way to write this.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.
scalarnotscaler.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.
Done