SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S



1
(4)
2
3
4
(2)
5
(3)
6
(1)
7
(3)
8
(7)
9
(2)
10
(1)
11
(3)
12
13
14
(3)
15
16
(4)
17
(4)
18
(1)
19
20
(1)
21
(3)
22
(2)
23
(2)
24
(1)
25
26
27
(3)
28
29
30


Showing 1 results of 1

From: <ef...@us...> - 2010年09月06日 01:52:04
Revision: 8682
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8682&view=rev
Author: efiring
Date: 2010年09月06日 01:51:58 +0000 (2010年9月06日)
Log Message:
-----------
figure.py, axes tracking: ensure a unique key is provided.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py	2010年09月05日 19:33:42 UTC (rev 8681)
+++ trunk/matplotlib/lib/matplotlib/figure.py	2010年09月06日 01:51:58 UTC (rev 8682)
@@ -82,6 +82,14 @@
 hash(key)
 except TypeError:
 raise ValueError("first argument, %s, is not a valid key" % key)
+
+ a_existing = self.get(key)
+ if a_existing is not None:
+ Stack.remove(self, (key, a_existing))
+ warnings.Warn(
+ "key %s already existed; Axes is being replaced" % key)
+ # I don't think the above should ever happen.
+
 if a in self:
 return None
 return Stack.push(self, (key, a))
@@ -648,15 +656,14 @@
 
 %(Axes)s
 """
+ if not len(args): return
 
 key = self._make_key(*args, **kwargs)
-
 ax = self._axstack.get(key)
 if ax is not None:
 self.sca(ax)
 return ax
 
- if not len(args): return
 if isinstance(args[0], Axes):
 a = args[0]
 assert(a.get_figure() is self)
@@ -674,8 +681,7 @@
 
 a = projection_factory(projection, self, rect, **kwargs)
 
- if a not in self._axstack:
- self._axstack.add(key, a)
+ self._axstack.add(key, a)
 self.sca(a)
 return a
 
@@ -708,15 +714,17 @@
 
 %(Axes)s
 """
+ if not len(args): return
 
- kwargs = kwargs.copy()
+ if len(args) == 1 and isinstance(args[0], int):
+ args = tuple([int(c) for c in str(args[0])])
 
- if not len(args): return
-
 if isinstance(args[0], SubplotBase):
 a = args[0]
 assert(a.get_figure() is self)
+ key = self._make_key(*args, **kwargs)
 else:
+ kwargs = kwargs.copy()
 ispolar = kwargs.pop('polar', False)
 projection = kwargs.pop('projection', None)
 if ispolar:
@@ -729,6 +737,7 @@
 
 projection_class = get_projection_class(projection)
 
+ # Remake the key without projection kwargs:
 key = self._make_key(*args, **kwargs)
 ax = self._axstack.get(key)
 if ax is not None:
@@ -737,6 +746,11 @@
 return ax
 else:
 self._axstack.remove(ax)
+ # Undocumented convenience behavior:
+ # subplot(111); subplot(111, projection='polar')
+ # will replace the first with the second.
+ # Without this, add_subplot would be simpler and
+ # more similar to add_axes.
 
 a = subplot_class_factory(projection_class)(self, *args, **kwargs)
 self._axstack.add(key, a)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 1 results of 1

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /