GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Offset and scaling factors in axis format #4376 by VincentVandalon · Pull Request #6086 · matplotlib/matplotlib ConversationFeature/Ticket #4376 : Implemented functionality to let the user set an offset or
Possible code to test the features: ########## #Y-axis tests default #X-axis test user-set functions #left column = scaling, right column = offset #top row = (0...1)*1E10, bottom row = (0..1)+1E10 ########## import numpy as np import scipy as sp import matplotlib.pyplot as plt scal=1E10 ##############1 plt.subplot(221) x=sp.rand(100)*scal y=1000+x plt.scatter(x,y) plt.gca().get_xaxis().get_major_formatter().set_useScalingFactor(scal) ##############2 plt.subplot(222) x=sp.rand(100)*scal y=1000+x plt.scatter(x,y) plt.gca().get_xaxis().get_major_formatter().set_useOffset(scal) ##############3 plt.subplot(223) x=sp.rand(100)+scal y=1000+x plt.scatter(x,y,c='r') plt.gca().get_xaxis().get_major_formatter().set_useScalingFactor(scal) ##############4 plt.subplot(224) x=sp.rand(100)+scal y=1000+x plt.scatter(x,y,c='r') plt.gca().get_xaxis().get_major_formatter().set_useOffset(scal) #plt.gca().get_xaxis().get_major_formatter().set_offset_string('') plt.tight_layout() plt.savefig('test.pdf')
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsa scaling factor for a specific axis using ScalarFormatter. - Scaling and offset have become exclusive: either scaling or offset or nothing. - This also resolves ambiguity as (x-offset)/scalar != (x/scalar-offset) - Added a new method set_useScalingFactor(True|False|value) - Wrote documentation for both set_useOffset(True|False|value) and set_useScalingFactor() - Fixed an (unreported) bug in HEAD that ignored the offset when scaling was performed automatically due to scientific notation - rcParams['axes.formatter.useoffset'] still controls whether to use offset when guessing best format. - set_powerlimits() still controls whether scaling is automatically performed
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. …y returned by get_useOffset(). get_useOffset() returns whether an offset has been set either by the user or by _set_offset()
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
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. Please do not commit this change. The same effect can be achived by in the enviroment you are building in.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
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. Thanks for taking the time to review the changes this thoroughly! I am learning a lot from it. Done (this change was not intended)
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
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.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
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.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
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
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
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. There needs to be a space before the
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. - Refactored functionality of ScalarFormatter to be more readable - Separated logic deciding to perform auto scaling / offset from functions calculating the best possible scaling / offset values - Grouped methods in a logical way (user interaction, inherited, and local) - Removed space before the times sign in the scientific notation / scaling. Changed test images to reflect this. - Changed rcparam test back to original function - Removed _scientific boolean and the function set_scientific() as they were not used anywhere (just grep the original file). The existence of the function and boolean might mislead the user that changing this bool might affect the plotting.
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. Start reading here to follow the flow of the code (this is called at plot time).
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers1 more reviewerUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||