Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed old test and changed code to respect rcParams
  • Loading branch information
VincentVandalon committed Mar 2, 2016
commit fee8ab9915201ab891e2abae08f1e6ca37754975
8 changes: 4 additions & 4 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,6 @@ def __init__(self, useOffset=None, useMathText=None, useLocale=None):

self.set_useOffset(False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it no longer uses the rcparam?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still honors the rcparam, see line 671 and 672. I (probably) should have been clearer about this in the commit message.

_useoffset and get_useOffset() now indicates if the offset has been set by either the user or the algorithm choosing a good offset; It no longer return the same value as the rcParam.

axes.formatter.useoffset = False now disables the automatic algorithm. The user can still manually set an offset
axes.formatter.useoffset = True allows the automatic algorithm to set an offset. The user can still override this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The practice in the rest of the library is that the value of the rcparams are stashed when the artists are created. In part this is so that the rcparams context manager and in part so that we can be sure of when the rcprams are consulted (many things are deffered to draw time).

self.set_useScalingFactor(False)
if rcParams['axes.formatter.useoffset'] is True:
self._currentMode = self.mode['offset']
self._currentMode = self.mode['none']

self._usetex = rcParams['text.usetex']
Expand Down Expand Up @@ -677,8 +675,10 @@ def set_locs(self, locs):

def _set_offset(self, range):
# Determine if an offset is needed and if so, set it.
# This is only needed when scaling/offset hasn't been set by the user
if self._currentMode != self.mode['none']:
# Don't do this if scaling/offset has been set of it is
# rcParams forbids automatic offset
if (self._currentMode != self.mode['none'] or
rcParams['axes.formatter.useoffset'] is False) :
return

# offset of 20,001 is 20,000, for example
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# set this to True. It will download and build a specific version of
# FreeType, and then use that to build the ft2font extension. This
# ensures that test images are exactly reproducible.
#local_freetype = False
local_freetype = True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not commit this change.

The same effect can be achived by

export MPLLOCALFREETYPE=1

in the enviroment you are building in.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to review the changes this thoroughly! I am learning a lot from it.

Done (this change was not intended)


[status]
# To suppress display of the dependencies and their versions
Expand Down