GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — allow kwargs `transform` to work for axvspan, axhspan, axvline, axhline by kaufman · Pull Request #91 · matplotlib/matplotlib

Conversation

@kaufman

@kaufman kaufman commented Apr 24, 2011

Copy link
Copy Markdown
Contributor

This patch removes the prohibition on using the 'transform' option for axhline and axvline and changes the code order so that a user-passed transform option will work with axhspan and axvspan.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
efiring and others added 30 commits August 27, 2010 07:13
@efiring
backend_qt4: don't make app if ipython already made it; patch by Bria…
d400dc5
…n Granger

svn path=/trunk/matplotlib/; revision=8664
@dopplershift
Fix some issues with saving movies from FuncAnimation. The initializa…
3bd15be
…tion draw was putting data in the saved sequence, which needed to be removed. Also, handle the case where there is no saved sequence. Make sure to disconnect signals for first draw, otherwise saving the movie will start the animation.

svn path=/trunk/matplotlib/; revision=8665
@dopplershift
Add some TODO's and remove some debug code.
deeb98d
svn path=/trunk/matplotlib/; revision=8666
@leejjoon
Merged revisions 8652,8667 via svnmerge from
c108b92
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8652 | efiring | 2010-08-21 13:49:53 -0400 (Sat, 21 Aug 2010) | 2 lines
  
  Axis.set_view_interval: when updating, respect original orientation
........
  r8667 | leejjoon | 2010-08-28 11:54:32 -0400 (Sat, 28 Aug 2010) | 1 line
  
  fix gridspec bug that location is wrongly calculated for non-square grid
........

svn path=/trunk/matplotlib/; revision=8668
@efiring
Merged revisions 8673 via svnmerge from
da53e51
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8673 | efiring | 2010-09-01 09:44:36 -1000 (Wed, 01 Sep 2010) | 2 lines
  
  [3054467] fix bug in PatchCollection; restore attribute access to Patch.fill
........

svn path=/trunk/matplotlib/; revision=8674
@efiring
Merged revisions 8675 via svnmerge from
7af277b
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8675 | efiring | 2010-09-01 13:39:49 -1000 (Wed, 01 Sep 2010) | 2 lines
  
  PatchCollection: handle linestyles correctly; patch by Thomas Robitaille
........

svn path=/trunk/matplotlib/; revision=8676
@efiring
Merged revisions 8677 via svnmerge from
cbf3719
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8677 | efiring | 2010-09-04 11:17:58 -1000 (Sat, 04 Sep 2010) | 2 lines
  
  doc patch by Christoph Gohlke
........

svn path=/trunk/matplotlib/; revision=8678
@efiring
Merged revisions 8679 via svnmerge from
2840392
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8679 | efiring | 2010-09-04 14:38:45 -1000 (Sat, 04 Sep 2010) | 2 lines
  
  [3024007] Fix ancient bug in hist inherited from numpy, fixed in numpy 1.5
........

svn path=/trunk/matplotlib/; revision=8680
@efiring
[3050996] Prevent an Axes from being added to a Figure twice.
5e2a5fa
The changeset includes refactoring to consolidate all Axes
tracking in a single data structure.

svn path=/trunk/matplotlib/; revision=8681
@efiring
figure.py, axes tracking: ensure a unique key is provided.
f2d3cf7
svn path=/trunk/matplotlib/; revision=8682
@efiring
figure.py: preserve the order in which Axes were added to the figure
fb70c3f
svn path=/trunk/matplotlib/; revision=8693
@jkseppan
Remind make.osx users to set PREFIX
39694cb
svn path=/trunk/matplotlib/; revision=8695
@dopplershift
Merged revisions 8690-8691,8696-8697 via svnmerge from
e16060e
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8690 | mdboom | 2010-09-08 09:32:17 -0500 (Wed, 08 Sep 2010) | 2 lines
  
  [3058804] part of a line is not drawn
........
  r8691 | mdboom | 2010-09-08 10:51:18 -0500 (Wed, 08 Sep 2010) | 2 lines
  
  Another pass at fixing simplification.
........
  r8696 | ryanmay | 2010-09-11 14:02:38 -0500 (Sat, 11 Sep 2010) | 1 line
  
  Fix typo in griddata().
........
  r8697 | ryanmay | 2010-09-11 14:03:52 -0500 (Sat, 11 Sep 2010) | 1 line
  
  Handle multple calls to GTKTimer.start() by stopping any existing gtk timer id.
........

svn path=/trunk/matplotlib/; revision=8698
@mdboom
Merged revisions 8699-8700 via svnmerge from
d8c86dc
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8699 | mdboom | 2010-09-14 11:21:21 -0400 (Tue, 14 Sep 2010) | 2 lines
  
  Fix semi-transparent Gouraud triangle rendering in SVG backend.
........
  r8700 | mdboom | 2010-09-14 11:53:59 -0400 (Tue, 14 Sep 2010) | 2 lines
  
  Fix mismatched opening/closing group.
........

svn path=/trunk/matplotlib/; revision=8701
@efiring
Removed unused _wxagg extension.
89435dd
svn path=/trunk/matplotlib/; revision=8702
@efiring
Remove obsolete numerix.h
1718e0a
svn path=/trunk/matplotlib/; revision=8703
@WeatherGod
Merged revisions 8704 via svnmerge from
cc58607
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8704 | weathergod | 2010-09-16 11:45:43 -0500 (Thu, 16 Sep 2010) | 3 lines
  
  change pointer offset from type int to size_t, which caused problems with showing very high res images.
  This fixes bug ID 3054444.
........

svn path=/trunk/matplotlib/; revision=8705
@efiring
Merged revisions 8706 via svnmerge from
fc0c773
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8706 | efiring | 2010-09-16 16:46:04 -1000 (Thu, 16 Sep 2010) | 5 lines
  
  include Python.h first in extension code; patch by Jason Grout.
  This cleans up the preprocessor directives and allows compilation on Solaris.
  A preprocessor directive is added to keep png.h from failing on Linux
  because Python.h has caused setjmp.h to be included.
........

svn path=/trunk/matplotlib/; revision=8707
@efiring
Merged revisions 8708 via svnmerge from
6e7f26f
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8708 | efiring | 2010-09-16 20:41:34 -1000 (Thu, 16 Sep 2010) | 2 lines
  
  including Python.h and png.h: a second try, special case for linux
........

svn path=/trunk/matplotlib/; revision=8709
@mdehoon
Adding gouraud plots to the Mac OS X native backend.
8c6fc0b
svn path=/trunk/matplotlib/; revision=8710
@mdboom
Merged revisions 8711-8712 via svnmerge from
f8e4c6c
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8711 | mdboom | 2010-09-20 12:58:14 -0400 (Mon, 20 Sep 2010) | 2 lines
  
  Fix clipped text in example.
........
  r8712 | mdboom | 2010-09-21 16:13:25 -0400 (Tue, 21 Sep 2010) | 2 lines
  
  If a font file is looked up in the cache, but that font file no longer exists on disk, rebuild the cache.
........

svn path=/trunk/matplotlib/; revision=8713
@jdh2358
Merged revisions 8714-8715 via svnmerge from
de74e56
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8714 | mdboom | 2010-09-21 15:18:48 -0500 (Tue, 21 Sep 2010) | 2 lines
  
  Bug #
........
  r8715 | jdh2358 | 2010-09-22 07:46:38 -0500 (Wed, 22 Sep 2010) | 1 line
  
  added Bartosz Telenczuk's artist demo
........

svn path=/trunk/matplotlib/; revision=8716
@leejjoon
Merged revisions 8717-8718,8720 via svnmerge from
dee0f95
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8717 | jdh2358 | 2010-09-24 04:54:34 +0900 (Fri, 24 Sep 2010) | 1 line
  
  added citation faq
........
  r8718 | jdh2358 | 2010-09-24 05:07:12 +0900 (Fri, 24 Sep 2010) | 1 line
  
  wrap the mpl citation abstract
........
  r8720 | leejjoon | 2010-09-27 10:30:19 +0900 (Mon, 27 Sep 2010) | 1 line
  
  fix bezier.get_parallerls to handle parallel input lines
........

svn path=/trunk/matplotlib/; revision=8721
@efiring
Merged revisions 8722-8725 via svnmerge from
6baa03e
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint

........
  r8722 | efiring | 2010-09-27 08:51:05 -1000 (Mon, 27 Sep 2010) | 2 lines
  
  Clarify docstrings for autoscale_view and relim.
........
  r8723 | efiring | 2010-10-03 10:45:38 -1000 (Sun, 03 Oct 2010) | 2 lines
  
  docs: in event_handling, note that weak references to callbacks are used.
........
  r8724 | efiring | 2010-10-03 11:04:10 -1000 (Sun, 03 Oct 2010) | 2 lines
  
  errorbar bugfix: plot everything regardless of the Axes hold state
........
  r8725 | efiring | 2010-10-03 11:17:39 -1000 (Sun, 03 Oct 2010) | 2 lines
  
  bugfix: applied patch by Stan West to fix error in colormap reversal
........

svn path=/trunk/matplotlib/; revision=8726
@jkseppan
Fix JPEG saving bug: only accept the kwargs documented by PIL for JPE…
10d939a
…G files.

svn path=/trunk/matplotlib/; revision=8727
@mdboom
Speed up Gouraud triangles in Agg backend.
0c2ac6d
svn path=/trunk/matplotlib/; revision=8728
@dopplershift
Move import of traceback to only occur in the event of an exception.
ed2767c
svn path=/trunk/matplotlib/; revision=8729
@dopplershift
contains() was relying on some attributes being set by draw(). Add co…
85ebe51
…de to make contains() not cause a traceback if draw() has not been called.

svn path=/trunk/matplotlib/; revision=8730
@mdboom
[3081451] symlog doesn't handle values <1.0 correctly
5e69d16
svn path=/trunk/matplotlib/; revision=8731
@mdboom
Fix r8732 and update regression tests.
8034dc0
svn path=/trunk/matplotlib/; revision=8733
mdboom and others added 25 commits April 1, 2011 12:08
@mdboom
Remove out-of-date information about backend capabilities
2deb0a4
@mdboom
Remove out-of-date information about interactive prompts.
b127ac3
@mdboom
Remove out-of-date information about segfaults.
f7a3164
@mdboom
Remove out-of-date information about known bugs. This has been superc…
4972fd9
…eded by the bug tracker.
@mdboom
Note that we now require Sphinx 1.0
cbedb35
@mdboom
Update description of contents of doc directory.
8f09688
@mdboom
Update information about running tests.
7a5f3d5
@mdboom
Update LICENSE file to current version.
0ed096b
@mdboom
Use Sphinx' inheritance diagram directive instead of our local fork.
b785062
@mdboom
Document the contents of the example directories.
7b24b2a
@ddale
Merge remote-tracking branch 'mdboom/use_sphinx_inheritance_diagram'
23f13dc
@ddale
Merge remote-tracking branch 'mdboom/add_pngsuite_test_to_regression_…
39de1e5
…framework'
@ddale
Merge branch 'v1.0.x'
60dec25
@ddale
Merge branch 'v1.0.x'
4ef0163
@ddale
fix a few more sphinx warnings
be14152
@mdboom
Merge branch 'plot_directive' of github.com:mdboom/matplotlib into pl…
403c5b8
…ot_directive

Conflicts:
	lib/matplotlib/sphinxext/plot_directive.py
@mdboom
Remove incorrect item from CHANGELOG
eecadbb
@mdboom
Merge branch 'plot_directive' of github.com:mdboom/matplotlib into mi…
6926044
…nor_doc_fixes

Conflicts:
	lib/matplotlib/sphinxext/plot_directive.py
@ddale
fixes a few rest formatting issues
969ddd8
@ddale
add common font paths to font_manager
4799341
@ddale
Merge branch 'v1.0.x'
3705a2f
@mdboom
Merge branch 'master' of github.com:matplotlib/matplotlib
b754a0c
@mdboom
Merge branches 'v1.0.x' and 'master'
0d81e67
@mdboom
Merge branch 'minor_doc_fixes' of https://github.com/mdboom/matplotlib …
4bcec9c
…into mdboom-minor_doc_fixes

Conflicts:
	.gitignore
	CHANGELOG
	doc/faq/installing_faq.rst
	doc/sphinxext/inheritance_diagram.py
	doc/users/recipes.rst
@kaufman
allow kwargs transform to work for axvspan, axhspan, axvline, axhline
e3d8d94
	modified:   axes.py
efiring
efiring reviewed Apr 24, 2011
View reviewed changes
Comment thread lib/matplotlib/axes.py

@efiring efiring Apr 24, 2011

Copy link
Copy Markdown
Member

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.

My preferred idiom would be:
kwargs.setdefault('transform', trans)
Then you don't need the comment above it. If this line immediately follows the definition of trans, then you don't need the comment above that, either.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kaufman kaufman Apr 24, 2011

Copy link
Copy Markdown
Contributor Author

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.

right, I guess that makes it obvious that I'm still a python newbie.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@efiring

efiring commented Apr 24, 2011

Copy link
Copy Markdown
Member

Apart from the stylistic suggestion in the line note, I am ambivalent about the change. The essence of these methods is in their blended transform; they exist to provide easy access to that advanced feature. This is stated right at the start of the docstring. Allowing a transform kwarg subverts that essence. Is the motivation that you want to be able to give the both sets of coordinates in axes units? In the spirit of these methods as convenience methods, hiding the transform complexity from the user, you could do that with a kwarg, e.g.,
ax.axhspan(0.1, 0.2, yunits='axes') # default would be 'data'
and then modify the docstring accordingly and code.
If this is not a common enough need, then anyone who knows how to set a Line2D transform kwarg probably also knows how to generate the desired result with two lines of code (make a line, add it to the axes) and doesn't need the convenience method at all.

On the positive side, I can see taking the point of view that the change is harmless because anyone who puts in a transform kwarg presumably understands how it is overriding the normal behavior; and anyone who does not put in the kwarg will never know the difference. Suitably condensed, the change slightly simplifies the code while expanding its capabilities.

Now I see another problem, however: the scalex,scaley logic is based on the assumption that the default transform is being used. Yes, you could fix that; but it seems to me like just one more indication that it would be better to leave the methods alone, or possibly use the kwarg approach. In other words, there is a good reason these methods disallow passing an arbitrary transform.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@efiring efiring closed this May 17, 2011
@richbwood richbwood mentioned this pull request Dec 19, 2012
test_pcolormesh hangs #1609
Closed
@aschilas aschilas mentioned this pull request May 16, 2014
vistrails ImportError: No module named pylab.plot #3069
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

15 participants

@kaufman @efiring @tacaswell @dsentinel @dopplershift @leejjoon @jkseppan @mdboom @WeatherGod @mdehoon @jdh2358 @ivanov @ddale @faucon @astropy-buildbot
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.