Skip to content

Commit f8e1599

Browse files
committed
updates to rc and scaling for docs to get nice sizes for html and pdf
svn path=/trunk/matplotlib/; revision=5518
1 parent 6a73575 commit f8e1599

File tree

10 files changed

+17
-40
lines changed

10 files changed

+17
-40
lines changed

doc/devel/documenting_mpl.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ the images from the python script and including either a png copy for
115115
html or a pdf for latex::
116116

117117
.. plot:: pyplot_simple.py
118-
:scale: 75
119118
:include-source:
120119

121-
The ``:scale:`` directive rescales the image to some percentage of the original
122-
size. ``:include-source:`` will present the contents of the file, marked up as
123-
source code.
120+
The ``:scale:`` directive rescales the image to some percentage of the
121+
original size, though we don't recommend using this in most cases
122+
since it is probably better to choose the correct figure size and dpi
123+
in mpl and let it handle the scaling. ``:include-source:`` will
124+
present the contents of the file, marked up as source code.
124125

125126
Static figures
126127
--------------

doc/matplotlibrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ numerix : numpy # numpy, Numeric or numarray
233233

234234
### FIGURE
235235
# See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure
236-
#figure.figsize : 8, 6 # figure size in inches
236+
figure.figsize : 6, 4 # figure size in inches
237237
#figure.dpi : 80 # figure dots per inch
238238
#figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray
239239
#figure.edgecolor : white # figure edgecolor

doc/sphinxext/plot_directive.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@
4343
template_no_source = """
4444
.. htmlonly::
4545
46+
[ `<../%(srcdir)s/%(reference)s>`__,
47+
`png <../%(srcdir)s/%(basename)s.hires.png>`__,
48+
`pdf <../%(srcdir)s/%(basename)s.pdf>`__ ]
49+
4650
.. image:: ../%(srcdir)s/%(basename)s.png
4751
%(options)s
4852
49-
`[%(basename)s source py] <../%(srcdir)s/%(reference)s>`_
50-
`[%(basename)s highres png] <../%(srcdir)s/%(basename)s.hires.png>`_
51-
`[%(basename)s pdf] <../%(srcdir)s/%(basename)s.pdf>`_
5253
5354
.. latexonly::
5455
.. image:: ../%(srcdir)s/%(basename)s.pdf
@@ -61,13 +62,13 @@
6162
6263
.. htmlonly::
6364
65+
[ `py <../%(srcdir)s/%(reference)s>`__,
66+
`png <../%(srcdir)s/%(basename)s.hires.png>`__,
67+
`pdf <../%(srcdir)s/%(basename)s.pdf>`__ ]
68+
6469
.. image:: ../%(srcdir)s/%(basename)s.png
6570
%(options)s
6671
67-
`[%(basename)s source py] <../%(srcdir)s/%(reference)s>`_
68-
`[%(basename)s highres png] <../%(srcdir)s/%(basename)s.hires.png>`_
69-
`[%(basename)s pdf] <../%(srcdir)s/%(basename)s.pdf>`_
70-
7172
.. latexonly::
7273
.. image:: ../%(srcdir)s/%(basename)s.pdf
7374
%(options)s
@@ -103,15 +104,11 @@ def makefig(fullpath, outdir):
103104

104105
mplshell.magic_run(fullpath)
105106
for format, dpi in formats:
106-
#print 'saving', outdir, basename, format
107107
outname = os.path.join(outdir, '%s.%s' % (basename, format))
108108
plt.savefig(outname, dpi=dpi)
109109
print ' all figures made'
110110

111111
def run(arguments, options, state_machine, lineno):
112-
#print 'arguments', arguments
113-
#print 'options', options
114-
115112
reference = directives.uri(arguments[0])
116113
basename, ext = os.path.splitext(reference)
117114

doc/users/annotations.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ arguments are ``(x,y)`` tuples.
1414

1515
.. plot:: annotation_basic.py
1616
:include-source:
17-
:scale: 75
17+
1818

1919
In this example, both the ``xy`` (arrow tip) and ``xytext`` locations
2020
(text location) are in data coordinates. There are a variety of other
@@ -73,7 +73,6 @@ keyword args like ``horizontalalignment``, ``verticalalignment`` and
7373
``Text`` instance
7474

7575
.. plot:: annotation_polar.py
76-
:scale: 75
7776
:include-source:
7877

7978
See the `annotations demo

doc/users/artists.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ drawing of the ticks, tick labels and axis labels.
136136
Try creating the figure below.
137137

138138
.. plot:: fig_axes_labels_simple.py
139-
:scale: 75
140139

141140
.. _customizing-artists:
142141

@@ -327,7 +326,6 @@ obtain by setting the ``Artist`` transform to :attr:`fig.transFigure
327326
In [195]: fig.canvas.draw()
328327

329328
.. plot:: fig_x.py
330-
:scale: 75
331329

332330

333331
Here is a summary of the Artists the figure contains
@@ -605,7 +603,6 @@ Here is an example, not recommended for its beauty, which customizes
605603
the axes and tick properties
606604

607605
.. plot:: fig_axes_customize_simple.py
608-
:scale: 75
609606
:include-source:
610607

611608

@@ -643,5 +640,4 @@ Here is an example which sets the formatter for the upper ticks with
643640
dollar signs and colors them green on the right side of the yaxis
644641

645642
.. plot:: dollar_ticks.py
646-
:scale: 75
647643
:include-source:

doc/users/mathtext.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ Example
272272
Here is an example illustrating many of these features in context.
273273

274274
.. plot:: pyplot_mathtext.py
275-
:scale: 75
276275
:include-source:
277276

278277

doc/users/navigation_toolbar.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@ Interactive navigation
44
======================
55

66
.. image:: ../_static/toolbar.png
7-
:scale: 100
87

98
All figure windows come with a navigation toolbar, which can be used
109
to navigate through the data set. Here is a description of each of
1110
the buttons at the bottom of the toolbar
1211

1312
.. image:: ../mpl_data/images/home.png
14-
:scale: 100
1513

1614
.. image:: ../mpl_data/images/back.png
17-
:scale: 100
1815

1916
.. image:: ../mpl_data/images/forward.png
20-
:scale: 100
2117

2218
The ``Forward`` and ``Back`` buttons
2319
These are akin to the web browser forward and back buttons. They
@@ -31,7 +27,6 @@ The ``Forward`` and ``Back`` buttons
3127
the pan and zoom to rectangle to define new views.
3228

3329
.. image:: ../mpl_data/images/move.png
34-
:scale: 100
3530

3631
The ``Pan/Zoom`` button
3732
This button has two modes: pan and zoom. Click the toolbar button
@@ -56,7 +51,6 @@ The ``Pan/Zoom`` button
5651
right mouse button.
5752

5853
.. image:: ../mpl_data/images/zoom_to_rect.png
59-
:scale: 100
6054

6155
The ``Zoom-to-rectangle`` button
6256
Click this toolbar button to activate this mode. Put your mouse
@@ -68,15 +62,13 @@ The ``Zoom-to-rectangle`` button
6862
region defined by the zoom out rectangle.
6963

7064
.. image:: ../mpl_data/images/subplots.png
71-
:scale: 100
7265

7366
The ``Subplot-configuration`` button
7467
Use this tool to configure the parameters of the subplot: the
7568
left, right, top, bottom, space between the rows and space between
7669
the columns.
7770

7871
.. image:: ../mpl_data/images/filesave.png
79-
:scale: 100
8072

8173
The ``Save`` button
8274
Click this button to launch a file save dialog. You can save

doc/users/pyplot_tutorial.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ keeps track of the current figure and plotting area, and the plotting
1313
functions are directed to the current axes
1414

1515
.. plot:: pyplot_simple.py
16-
:scale: 75
1716
:include-source:
1817

1918
You may be wondering why the x-axis ranges from 0-3 and the y-axis
@@ -38,7 +37,6 @@ The default format string is 'b-', which is a solid blue line. For
3837
example, to plot the above with red circles, you would issue
3938

4039
.. plot:: pyplot_formatstr.py
41-
:scale: 75
4240
:include-source:
4341

4442
See the :func:`~matplotlib.pyplot.plot` documentation for a complete
@@ -55,7 +53,6 @@ plotting several lines with different format styles in one command
5553
using arrays.
5654

5755
.. plot:: pyplot_three.py
58-
:scale: 75
5956
:include-source:
6057

6158
.. _controlling-line-properties:
@@ -161,7 +158,6 @@ to worry about this, because it is all taken care of behind the
161158
scenes. Below is an script to create two subplots.
162159

163160
.. plot:: pyplot_two_subplots.py
164-
:scale: 75
165161
:include-source:
166162

167163
The :func:`~matplotlib.pyplot.figure` command here is optional because
@@ -221,9 +217,9 @@ are used tox add text in the indicated locations (see :ref:`text-intro`
221217
for a more detailed example)
222218

223219
.. plot:: pyplot_text.py
224-
:scale: 75
225220
:include-source:
226221

222+
227223
All of the :func:`~matplotlib.pyplot.text` commands return an
228224
:class:`matplotlib.text.Text` instance. Just as with with lines
229225
above, you can customize the properties by passing keyword arguments
@@ -265,9 +261,8 @@ functionality to make annotations easy. In an annotation, there are
265261
two points to consider: the location being annotated represented by
266262
the argument ``xy`` and the location of the text ``xytext``. Both of
267263
these arguments are ``(x,y)`` tuples.
268-
264+
269265
.. plot:: pyplot_annotate.py
270-
:scale: 75
271266
:include-source:
272267

273268
In this basic example, both the ``xy`` (arrow tip) and ``xytext``

doc/users/text_intro.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,4 @@ variety of font and other properties. The example below shows all of
5656
these commands in action.
5757

5858
.. plot:: text_commands.py
59-
:scale: 75
6059
:include-source:

doc/users/text_props.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,4 @@ bounding box, with 0,0 being the lower left of the axes and 1,1 the
5858
upper right.
5959

6060
.. plot:: text_layout.py
61-
:scale: 75
6261
:include-source:

0 commit comments

Comments
 (0)