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

Skip to content

Commit b14af91

Browse files
committed
added ticker api docs
svn path=/trunk/matplotlib/; revision=6297
1 parent 047d077 commit b14af91

7 files changed

Lines changed: 149 additions & 61 deletions

File tree

API_CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Changes for 0.98.x
22
==================
33

4-
* Restored 0.91 behavior of get_xlim/ylim returning a tuple
5-
rather than array - JDH
4+
* set_xlim, ylim now return a copy of the viewlim array to
5+
avoid modify inplace surprises
66

77
* AFM.get_fullname() and get_familyname() no longer raise an
88
exception if the AFM file does not specify these optional attributes,

CHANGELOG

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2008-10-21 Restored 0.91 behavior of get_xlim/ylim returning a tuple
2-
rather than array - JDH
1+
2008-10-21 set_xlim, ylim now return a copy of the viewlim array to
2+
avoid modify inplace surprises
33

44
2008-10-20 Added image thumbnail generating function
55
matplotlib.image.thumbnail. See

doc/api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626
mlab_api.rst
2727
path_api.rst
2828
pyplot_api.rst
29+
ticker_api.rst
2930
index_backend_api.rst

doc/api/ticker_api.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*******************
2+
matplotlib ticker
3+
*******************
4+
5+
6+
:mod:`matplotlib.ticker`
7+
==========================
8+
9+
.. automodule:: matplotlib.ticker
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:

doc/utils/pylab_names.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
"""
2+
autogenerate some tables for pylab namespace
3+
"""
4+
from pylab import *
5+
d = locals()
6+
keys = d.keys()
7+
keys.sort()
8+
9+
modd = dict()
10+
for k in keys:
11+
o = d[k]
12+
if not callable(o):
13+
continue
14+
doc = getattr(o, '__doc__', None)
15+
if doc is not None:
16+
doc = ' - '.join([line for line in doc.split('\n') if line.strip()][:2])
17+
18+
mod = getattr(o, '__module__', None)
19+
if mod is None:
20+
mod = 'unknown'
21+
22+
if mod is not None:
23+
if mod.startswith('matplotlib'):
24+
if k[0].isupper():
25+
k = ':class:`~%s.%s`'%(mod, k)
26+
else:
27+
k = ':func:`~%s.%s`'%(mod, k)
28+
mod = ':mod:`%s`'%mod
29+
elif mod.startswith('numpy'):
30+
#k = '`%s <%s>`_'%(k, 'http://scipy.org/Numpy_Example_List_With_Doc#%s'%k)
31+
k = '`%s <%s>`_'%(k, 'http://sd-2116.dedibox.fr/pydocweb/doc/%s.%s'%(mod, k))
32+
33+
34+
if doc is None: doc = 'TODO'
35+
36+
mod, k, doc = mod.strip(), k.strip(), doc.strip()[:80]
37+
modd.setdefault(mod, []).append((k, doc))
38+
39+
mods = modd.keys()
40+
mods.sort()
41+
for mod in mods:
42+
border = '*'*len(mod)
43+
print mod
44+
print border
45+
46+
print
47+
funcs, docs = zip(*modd[mod])
48+
maxfunc = max([len(f) for f in funcs])
49+
maxdoc = max(40, max([len(d) for d in docs]) )
50+
border = ' '.join(['='*maxfunc, '='*maxdoc])
51+
print border
52+
print ' '.join(['symbol'.ljust(maxfunc), 'description'.ljust(maxdoc)])
53+
print border
54+
for func, doc in modd[mod]:
55+
row = ' '.join([func.ljust(maxfunc), doc.ljust(maxfunc)])
56+
print row
57+
58+
print border
59+
print
60+
#break

lib/matplotlib/axes.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,9 +1769,10 @@ def set_xbound(self, lower=None, upper=None):
17691769

17701770
def get_xlim(self):
17711771
"""
1772-
Get the x-axis range [*xmin*, *xmax*]
1772+
Get the x-axis range as a length 2 attay [*xmin*, *xmax*]
17731773
"""
1774-
return tuple(self.viewLim.intervalx)
1774+
# # copy of the viewlim array to avoid modify inplace surprises
1775+
return self.viewLim.intervalx.copy()
17751776

17761777
def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs):
17771778
"""
@@ -1781,7 +1782,7 @@ def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs):
17811782
17821783
Set the limits for the xaxis
17831784
1784-
Returns the current xlimits as a length 2 tuple: [*xmin*, *xmax*]
1785+
Returns the current xlimits as a length 2 tuple: (*xmin*, *xmax*)
17851786
17861787
Examples::
17871788
@@ -1942,9 +1943,10 @@ def set_ybound(self, lower=None, upper=None):
19421943

19431944
def get_ylim(self):
19441945
"""
1945-
Get the y-axis range [*ymin*, *ymax*]
1946+
Get the y-axis range as a length two array [*ymin*, *ymax*]
19461947
"""
1947-
return tuple(self.viewLim.intervaly)
1948+
# copy of the viewlim array to avoid modify inplace surprises
1949+
return self.viewLim.intervaly.copy()
19481950

19491951
def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs):
19501952
"""

0 commit comments

Comments
 (0)