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

Skip to content

Commit 107bddd

Browse files
committed
applied Darren's sphinx patch, cleaned up some docstrings
svn path=/branches/v0_98_5_maint/; revision=6629
1 parent e93624b commit 107bddd

10 files changed

Lines changed: 80 additions & 95 deletions

File tree

doc/api/api_changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ The :class:`Polar` class has moved to :mod:`matplotlib.projections.polar`.
253253
`Axes.toggle_log_lineary()` has been removed.
254254
255255
:mod:`matplotlib.artist`
256-
~~~~~~~~~~~~~~~~~~~~~~~
256+
~~~~~~~~~~~~~~~~~~~~~~~~~~
257257

258258
============================================================ ============================================================
259259
Old method New method

doc/api/font_manager_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ matplotlib font_manager
1111
:show-inheritance:
1212

1313
:mod:`matplotlib.fontconfig_pattern`
14-
==============================
14+
========================================
1515

1616
.. automodule:: matplotlib.fontconfig_pattern
1717
:members:

doc/pyplots/plotmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# read in topo data (on a regular lat/lon grid)
1212
# longitudes go from 20 to 380.
1313
# you can get this data from matplolib svn matplotlib/htdocs/screenshots/data/
14-
datadir = '/home/jdhunter/python/svn/matplotlib/htdocs/screenshots/data/'
14+
datadir = '/home/jdhunter/python/svn/matplotlib/trunk/htdocs/screenshots/data/'
1515
if not os.path.exists(datadir):
1616
raise SystemExit('You need to download the data with svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/htdocs/screenshots/data/" and set the datadir variable in %s'%__file__)
1717

doc/sphinxext/inheritance_diagram.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ class E(B): pass
3939
from md5 import md5
4040

4141
from docutils.nodes import Body, Element
42-
from docutils.writers.html4css1 import HTMLTranslator
43-
from sphinx.latexwriter import LaTeXTranslator
4442
from docutils.parsers.rst import directives
4543
from sphinx.roles import xfileref_role
4644

@@ -409,12 +407,9 @@ def run(self):
409407
inheritance_diagram_directive)
410408

411409
def setup(app):
412-
app.add_node(inheritance_diagram)
413-
414-
HTMLTranslator.visit_inheritance_diagram = \
415-
visit_inheritance_diagram(html_output_graph)
416-
HTMLTranslator.depart_inheritance_diagram = do_nothing
417-
418-
LaTeXTranslator.visit_inheritance_diagram = \
419-
visit_inheritance_diagram(latex_output_graph)
420-
LaTeXTranslator.depart_inheritance_diagram = do_nothing
410+
app.add_node(inheritance_diagram,
411+
html=(visit_inheritance_diagram(html_output_graph),
412+
do_nothing))
413+
app.add_node(inheritance_diagram,
414+
latex=(visit_inheritance_diagram(latex_output_graph),
415+
do_nothing))

doc/sphinxext/mathmpl.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
from docutils import nodes
88
from docutils.parsers.rst import directives
9-
from docutils.writers.html4css1 import HTMLTranslator
10-
from sphinx.latexwriter import LaTeXTranslator
119
import warnings
1210

1311
# Define LaTeX math node:
@@ -69,8 +67,6 @@ def visit_latex_math_html(self, node):
6967
self.body.append(latex2html(node, source))
7068
def depart_latex_math_html(self, node):
7169
pass
72-
HTMLTranslator.visit_latex_math = visit_latex_math_html
73-
HTMLTranslator.depart_latex_math = depart_latex_math_html
7470

7571
# Add visit/depart methods to LaTeX-Translator:
7672
def visit_latex_math_latex(self, node):
@@ -83,8 +79,13 @@ def visit_latex_math_latex(self, node):
8379
'\\end{equation}'])
8480
def depart_latex_math_latex(self, node):
8581
pass
86-
LaTeXTranslator.visit_latex_math = visit_latex_math_latex
87-
LaTeXTranslator.depart_latex_math = depart_latex_math_latex
82+
83+
app.add_node(latex_math, html=(visit_latex_math_html,
84+
depart_latex_math_html))
85+
app.add_node(latex_math, latex=(visit_latex_math_latex,
86+
depart_latex_math_latex))
87+
app.add_role('math', math_role)
88+
8889

8990
from matplotlib import rcParams
9091
from matplotlib.mathtext import MathTextParser

doc/sphinxext/only_directives.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#
55

66
from docutils.nodes import Body, Element
7-
from docutils.writers.html4css1 import HTMLTranslator
8-
from sphinx.latexwriter import LaTeXTranslator
97
from docutils.parsers.rst import directives
108

119
class html_only(Body, Element):
@@ -63,9 +61,6 @@ class LatexOnlyDirective(OnlyDirective):
6361
directives.register_directive('latexonly', LatexOnlyDirective)
6462

6563
def setup(app):
66-
app.add_node(html_only)
67-
app.add_node(latex_only)
68-
6964
# Add visit/depart methods to HTML-Translator:
7065
def visit_perform(self, node):
7166
pass
@@ -76,12 +71,7 @@ def visit_ignore(self, node):
7671
def depart_ignore(self, node):
7772
node.children = []
7873

79-
HTMLTranslator.visit_html_only = visit_perform
80-
HTMLTranslator.depart_html_only = depart_perform
81-
HTMLTranslator.visit_latex_only = visit_ignore
82-
HTMLTranslator.depart_latex_only = depart_ignore
83-
84-
LaTeXTranslator.visit_html_only = visit_ignore
85-
LaTeXTranslator.depart_html_only = depart_ignore
86-
LaTeXTranslator.visit_latex_only = visit_perform
87-
LaTeXTranslator.depart_latex_only = depart_perform
74+
app.add_node(html_only, html=(visit_perform, depart_perform))
75+
app.add_node(html_only, latex=(visit_ignore, depart_ignore))
76+
app.add_node(latex_only, latex=(visit_perform, depart_perform))
77+
app.add_node(latex_only, html=(visit_ignore, depart_ignore))

doc/users/event_handling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Event name Class and description
6464
'scroll_event' :class:`~matplotlib.backend_bases.MouseEvent` - mouse scroll wheel is rolled
6565
'figure_enter_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse enters a new figure
6666
'figure_leave_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse leaves a figure
67-
'axes_enter_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse enters a new axes
68-
'axes_leave_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse leaves an axes
67+
'axes_enter_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse enters a new axes
68+
'axes_leave_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse leaves an axes
6969
======================= ======================================================================================
7070

7171
.. _event-attributes:

lib/matplotlib/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ def span_where(x, ymin, ymax, where, **kwargs):
703703
on the y-axis from *ymin* to *ymax*
704704
705705
A :class:`BrokenBarHCollection` is returned.
706-
**kwargs are passed on to the collection
706+
*kwargs* are passed on to the collection
707707
"""
708708
xranges = []
709709
for ind0, ind1 in mlab.contiguous_regions(where):

lib/matplotlib/pyplot.py

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ def subplot(*args, **kwargs):
603603
604604
*axisbg*:
605605
The background color of the subplot, which can be any valid
606-
color specifier. See :module:`matplotlib.colors` for more
606+
color specifier. See :mod:`matplotlib.colors` for more
607607
information.
608608
609609
*polar*:
@@ -1138,63 +1138,62 @@ def thetagrids(*args, **kwargs):
11381138
def plotting():
11391139
"""
11401140
Plotting commands
1141-
1142-
========= =================================================
1143-
Command Description
1144-
========= =================================================
1145-
axes Create a new axes
1146-
axis Set or return the current axis limits
1147-
bar make a bar chart
1148-
boxplot make a box and whiskers chart
1149-
cla clear current axes
1150-
clabel label a contour plot
1151-
clf clear a figure window
1152-
close close a figure window
1153-
colorbar add a colorbar to the current figure
1154-
cohere make a plot of coherence
1155-
contour make a contour plot
1156-
contourf make a filled contour plot
1157-
csd make a plot of cross spectral density
1158-
draw force a redraw of the current figure
1159-
errorbar make an errorbar graph
1160-
figlegend add a legend to the figure
1161-
figimage add an image to the figure, w/o resampling
1162-
figtext add text in figure coords
1163-
figure create or change active figure
1164-
fill make filled polygons
1141+
============ =================================================
1142+
Command Description
1143+
========= =================================================
1144+
axes Create a new axes
1145+
axis Set or return the current axis limits
1146+
bar make a bar chart
1147+
boxplot make a box and whiskers chart
1148+
cla clear current axes
1149+
clabel label a contour plot
1150+
clf clear a figure window
1151+
close close a figure window
1152+
colorbar add a colorbar to the current figure
1153+
cohere make a plot of coherence
1154+
contour make a contour plot
1155+
contourf make a filled contour plot
1156+
csd make a plot of cross spectral density
1157+
draw force a redraw of the current figure
1158+
errorbar make an errorbar graph
1159+
figlegend add a legend to the figure
1160+
figimage add an image to the figure, w/o resampling
1161+
figtext add text in figure coords
1162+
figure create or change active figure
1163+
fill make filled polygons
11651164
fill_between make filled polygons
1166-
gca return the current axes
1167-
gcf return the current figure
1168-
gci get the current image, or None
1169-
getp get a handle graphics property
1170-
hist make a histogram
1171-
hold set the hold state on current axes
1172-
legend add a legend to the axes
1173-
loglog a log log plot
1174-
imread load image file into array
1175-
imshow plot image data
1176-
matshow display a matrix in a new figure preserving aspect
1177-
pcolor make a pseudocolor plot
1178-
plot make a line plot
1179-
plotfile plot data from a flat file
1180-
psd make a plot of power spectral density
1181-
quiver make a direction field (arrows) plot
1182-
rc control the default params
1183-
savefig save the current figure
1184-
scatter make a scatter plot
1185-
setp set a handle graphics property
1186-
semilogx log x axis
1187-
semilogy log y axis
1188-
show show the figures
1189-
specgram a spectrogram plot
1190-
stem make a stem plot
1191-
subplot make a subplot (numrows, numcols, axesnum)
1192-
table add a table to the axes
1193-
text add some text at location x,y to the current axes
1194-
title add a title to the current axes
1195-
xlabel add an xlabel to the current axes
1196-
ylabel add a ylabel to the current axes
1197-
========= =================================================
1165+
gca return the current axes
1166+
gcf return the current figure
1167+
gci get the current image, or None
1168+
getp get a handle graphics property
1169+
hist make a histogram
1170+
hold set the hold state on current axes
1171+
legend add a legend to the axes
1172+
loglog a log log plot
1173+
imread load image file into array
1174+
imshow plot image data
1175+
matshow display a matrix in a new figure preserving aspect
1176+
pcolor make a pseudocolor plot
1177+
plot make a line plot
1178+
plotfile plot data from a flat file
1179+
psd make a plot of power spectral density
1180+
quiver make a direction field (arrows) plot
1181+
rc control the default params
1182+
savefig save the current figure
1183+
scatter make a scatter plot
1184+
setp set a handle graphics property
1185+
semilogx log x axis
1186+
semilogy log y axis
1187+
show show the figures
1188+
specgram a spectrogram plot
1189+
stem make a stem plot
1190+
subplot make a subplot (numrows, numcols, axesnum)
1191+
table add a table to the axes
1192+
text add some text at location x,y to the current axes
1193+
title add a title to the current axes
1194+
xlabel add an xlabel to the current axes
1195+
ylabel add a ylabel to the current axes
1196+
============ =================================================
11981197
11991198
The following commands will set the default colormap accordingly:
12001199

lib/matplotlib/ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class FixedFormatter(Formatter):
213213
'Return fixed strings for tick labels'
214214
def __init__(self, seq):
215215
"""
216-
seq is a sequence of strings. For positions ``i<len(seq)` return
216+
seq is a sequence of strings. For positions `i<len(seq)` return
217217
*seq[i]* regardless of *x*. Otherwise return ''
218218
"""
219219
self.seq = seq

0 commit comments

Comments
 (0)