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

Skip to content

Commit df99cd9

Browse files
committed
more faqs and codex example search keyword
svn path=/trunk/matplotlib/; revision=6244
1 parent b2780bd commit df99cd9

4 files changed

Lines changed: 110 additions & 48 deletions

File tree

doc/examples/gen_rst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
contents = '\n'.join([' %s'%row.rstrip() for row in contents.split('\n')])
115115

116116
fh.write(contents)
117-
fh.write('\n\n')
117+
fh.write('\n\nKeyword: codex (see :ref:`how-to-search-examples`)')
118118
fh.close()
119119

120120
fhsubdirIndex.close()

doc/faq/howto_faq.rst

Lines changed: 92 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Howto
99

1010
.. _howto-findobj:
1111

12-
How do I find all the objects in my figure of a certain type?
12+
Find all objects in figure of a certain type
1313
=============================================================
1414

1515
Every matplotlib artist (see :ref:`artist-tutorial`) has a method
@@ -35,7 +35,7 @@ You can also filter on class instances::
3535

3636
.. _howto-transparent:
3737

38-
How do I save transparent figures?
38+
Save transparent figures
3939
==================================
4040

4141
The :meth:`~matplotlib.pyplot.savefig` command has a keyword argument
@@ -64,7 +64,7 @@ on individual elements, eg::
6464

6565
.. _howto-subplots-adjust:
6666

67-
How do I move the edge of my axes area over to make room for my tick labels?
67+
Move the edge of an axes to make room for tick labels
6868
============================================================================
6969

7070
For subplots, you can control the default spacing on the left, right,
@@ -114,7 +114,7 @@ an example of placing axes manually.
114114

115115
.. _howto-auto-adjust:
116116

117-
How do I automatically make room for my tick labels?
117+
Automatically make room for tick labels
118118
====================================================
119119

120120
In most use cases, it is enough to simpy change the subplots adjust
@@ -148,7 +148,7 @@ over so that the tick labels fit in the figure
148148

149149
.. _howto-ticks:
150150

151-
How do I configure the tick linewidths?
151+
Configure the tick linewidths
152152
=======================================
153153

154154
In matplotlib, the ticks are *markers*. All
@@ -174,7 +174,7 @@ are ``markerfacecolor``, ``markeredgecolor``, ``markeredgewidth``,
174174

175175
.. _howto-align-label:
176176

177-
How do I align my ylabels across multiple subplots?
177+
Align my ylabels across multiple subplots
178178
===================================================
179179

180180
If you have multiple subplots over one another, and the y data have
@@ -191,7 +191,7 @@ setting in the right subplots.
191191

192192
.. _howto-webapp:
193193

194-
How do I use matplotlib in a web application server?
194+
Matplotlib in a web application server
195195
====================================================
196196

197197
Many users report initial problems trying to use maptlotlib in web
@@ -237,25 +237,25 @@ or by saving to a file handle::
237237
fig.savefig(sys.stdout)
238238

239239

240-
How do I use matplotlib with apache?
240+
matplotlib with apache
241241
------------------------------------
242242

243243
TODO
244244

245-
How do I use matplotlib with django?
245+
matplotlib with django
246246
------------------------------------
247247

248248
TODO
249249

250-
How do I use matplotlib with zope?
250+
matplotlib with zope
251251
----------------------------------
252252

253253
TODO
254254

255255

256256
.. _date-index-plots:
257257

258-
How do I skip dates where there is no data?
258+
Skip dates where there is no data
259259
===========================================
260260

261261
When plotting time series, eg financial time series, one often wants
@@ -292,7 +292,7 @@ to achieve the desired plot::
292292

293293
.. _point-in-poly:
294294

295-
How do I test whether a point is inside a polygon?
295+
Test whether a point is inside a polygon
296296
==================================================
297297

298298
The :mod:`matplotlib.nxutils` provides two high performance methods:
@@ -340,7 +340,7 @@ For a discussion of the implementation see `pnpoly
340340

341341
.. _how-to-submit-patch:
342342

343-
How do I submit a patch?
343+
Submit a patch
344344
========================
345345

346346
First obtain a copy of matplotlib svn (see :ref:`install-svn`) and
@@ -370,6 +370,72 @@ your patch abides by our coding conventions
370370
:ref:`developers-guide-index`.
371371

372372

373+
.. _how-to-contribute-docs:
374+
375+
Contribute to matplotlib documentation
376+
=========================================
377+
378+
matplotlib is a big library, which is used in many ways, and the
379+
documentation we have only scratches the surface of everything it can
380+
do. So far, the place most people have learned all these features are
381+
through studying the examples (:ref:`how-to-search-examples`), which is a
382+
recommended and great way to learn, but it would be nice to have more
383+
official narrative documentation guiding people through all the dark
384+
corners. This is where you come in.
385+
386+
There is a good chance you know more about matplotlib usage in some
387+
areas, the stuff you do every day, than any of the developers. *Just
388+
pulled your hair out compiling matplotlib for windows?* Write a FAQ or
389+
a section for the :ref:`installing` page. *Are you a digital signal
390+
processing wizard?* Write a tutorial on the signal analysis plotting
391+
functions like :func:`~matplotlib.pyplot.xcorr`,
392+
:func:`~matplotlib.pyplot.psd` and
393+
:func:`~matplotlib.pyplot.specgram`. *Do you use matplotlib with
394+
`django <ttp://www.djangoproject.com/>`_ or other popular web
395+
application servers?* Write a FAQ or tutorial and we'll find a place
396+
for it in the :ref:`users-guide-index`. *Bundle matplotlib in a `py2exe
397+
<http://www.py2exe.org/>`_ app?* ... I think you get the idea.
398+
399+
matplotlib is documented using the `sphinx
400+
<http://sphinx.pocoo.org/index.html>`_ extensions to restructured text
401+
`ReST <http://docutils.sourceforge.net/rst.html>`_. sphinx is a
402+
extensible python framework for documentation projects which generates
403+
HTML and PDF, and is pretty easy to write; you can see the source for this
404+
document or any page on this site by clicking on *Show Source* link
405+
at the end of the page in the sidebar (or `here
406+
<../_sources/faq/howto_faq.txt>`_ for this document).
407+
408+
The sphinx website is a good resource for learning sphinx, but we have
409+
put together a cheat-sheet at :ref:`documenting-matplotlib` which
410+
shows you how to get started, and outlines the matplotlib conventions
411+
and extensions, eg for including plots directly from external code in
412+
your documents.
413+
414+
Once your documentation contributions are working (and hopefully
415+
tested by actually *building* the docs) you can submit them as a patch
416+
against svn. See :ref:`install-svn` and :ref:`how-to-submit-patch`.
417+
Looking for something to do? Search for ``TODO`` at :`search`.
418+
419+
420+
.. _how-to-search-examples:
421+
422+
Search examples
423+
=========================================
424+
425+
The nearly 300 code :ref:`examples-index` included with the matplotlib
426+
source distribution are full-text searchable from the :ref:`search`
427+
page, but sometimes when you search, you get a lot of results from the
428+
:ref:`api-index` or other documentation that you may not be interested in if
429+
you just want to find a complete, free-standing, working piece of
430+
example code. To facilitate example searches, we have tagged every
431+
page with the keyword ``codex`` for *code example* which shouldn't
432+
appear anywhere else on this site except in the FAQ and in every
433+
example. So if you want to search for an example that uses an ellipse,
434+
:ref:`search` for ``codex ellipse``.
435+
436+
437+
438+
373439
.. _howto-click-maps:
374440

375441
Clickable images for HTML
@@ -385,7 +451,7 @@ to these efforts that would be great.
385451

386452
.. _howto-set-zorder:
387453

388-
How do I control the depth of plot elements?
454+
Control the depth of plot elements
389455
=============================================
390456

391457
Within an axes, the order that the various lines, markers, text,
@@ -409,7 +475,7 @@ lines are placed above or below your other plot elements.
409475

410476
.. _howto-axis-equal:
411477

412-
How to I make the aspect ratio for plots equal?
478+
Make the aspect ratio for plots equal
413479
===============================================
414480

415481
The Axes property :meth:`matplotlib.axes.Axes.set_aspect` controls the
@@ -427,13 +493,13 @@ some ratio which controls the ratio::
427493

428494
.. _howto-movie:
429495

430-
How do I make a movie?
496+
Make a movie
431497
======================
432498

433499

434500
If you want to take an animated plot and turn it into a movie, the
435501
best approach is to save a series of image files (eg PNG) and use an
436-
external tool to convert them to a movie. You can use ` mencoder
502+
external tool to convert them to a movie. You can use `mencoder
437503
<http://www.mplayerhq.hu/DOCS/HTML/en/mencoder.html>`_,
438504
which is part of the `mplayer <http://www.mplayerhq.hu>`_ suite
439505
for this::
@@ -475,7 +541,7 @@ a movie, and then cleans up::
475541

476542
.. _howto-twoscale:
477543

478-
Can I have multiple y-axis scales?
544+
Multiple y-axis scales
479545
==================================
480546

481547
A frequent request is to have two scales for the left and right
@@ -514,10 +580,10 @@ locators as desired since the two axes are independent::
514580

515581
See :ref:`api-two_scales` for a complete example
516582

517-
.. _howto-batchmode:
583+
.. _howto-batch:
518584

519-
Can I just generate images without having a window popup?
520-
=====================================================
585+
Generate images without having a window popup
586+
===========================================================
521587

522588
The easiest way to do this is use an image backend (see
523589
:ref:`what-is-a-backend`) such as Agg (for PNGs), PDF, SVG or PS. In
@@ -535,21 +601,17 @@ pyplot::
535601
.. seealso::
536602
:ref:`howto-webapp`
537603

538-
('SHOW',
539-
"What's up with 'show'? Do I have to use it?",
540-
"""
541-
542604
.. _howto-show
543605
544-
How should I use :func:`~matplotlib.pyplot.show`?
545-
=================================================
606+
Use :func:`~matplotlib.pyplot.show`
607+
=====================================================
546608

547609
The user interface backends need to start the GUI mainloop, and this
548610
is what :func:`~matplotlib.pyplot.show` does. It tells matplotlib to
549611
raise all of the figure windows and start the mainloop. Because the
550612
mainloop is blocking, you should only call this once per script, at
551613
the end. If you are using matplotlib to generate images only and do
552-
not want a user interface window, you can skip it (see
614+
not want a user interface window, you do not need to call ``show`` (see
553615
:ref:`howto-batch` and :ref:`what-is-a-backend`).
554616

555617

@@ -565,8 +627,8 @@ many times in a script such as the following::
565627

566628
It is *possible* to force matplotlib to draw after every command,
567629
which is what you usually want when working interactively at the
568-
python console, but in a script you want to defer all drawing until
569-
the script has executed (see :ref:`mpl-shell`). This is especially
630+
python console (see :ref:`mpl-shell`), but in a script you want to
631+
defer all drawing until the script has executed. This is especially
570632
important for complex figures that take some time to draw.
571633
:func:`~matplotlib.pyplot.show` is designed to tell matplotlib that
572634
you're all done issuing commands and you want to draw the figure now.

doc/faq/installing_faq.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
.. contents::
99

1010

11-
How do I report a compilation problem?
11+
Report a compilation problem
1212
======================================
1313

1414
See :ref:`reporting-problems`.
1515

16-
matplotlib compiled fine, but I can't get anything to plot
16+
matplotlib compiled fine, but nothing shows up with plot
1717
==========================================================
1818

1919
The first thing to try is a :ref:`clean install <clean-install>` and see if
@@ -42,7 +42,7 @@ If you are still having trouble, see :ref:`reporting-problems`.
4242

4343
.. _clean-install:
4444

45-
How do I cleanly rebuild and reinstall everything?
45+
Cleanly rebuild and reinstall everything
4646
==================================================
4747

4848
The steps depend on your platform and installation method.
@@ -93,7 +93,7 @@ install directory. To cleanly rebuild:
9393

9494
.. _install-svn:
9595

96-
How to install from svn?
96+
Install from svn
9797
========================
9898

9999
Checking out the main source::
@@ -236,7 +236,7 @@ FLTKAgg Agg rendering to a :term:`FLTK` canvas (requires pyFLTK_)
236236

237237
.. _pygtk-2.4:
238238

239-
How do I compile matplotlib with PyGTK-2.4?
239+
Compile matplotlib with PyGTK-2.4
240240
-------------------------------------------
241241

242242
There is a `bug in PyGTK-2.4`_. You need to edit
@@ -269,11 +269,11 @@ official OS X version from `python.org
269269

270270
.. _easy-install-osx-egg:
271271

272-
How can I easy_install my egg?
272+
easy_install from egg?
273273
------------------------------
274274

275-
I downloaded the egg for 0.98 from the matplotlib webpages,
276-
and I am trying to ``easy_install`` it, but I am getting an error::
275+
Some users have reported problems with the egg for 0.98 from the
276+
matplotlib download site, with ``easy_install``, getting an error::
277277

278278
> easy_install ./matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg
279279
Processing matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg
@@ -296,7 +296,7 @@ Windows questions
296296

297297
.. _windows-installers:
298298

299-
Where can I get binary installers for windows?
299+
Binary installers for windows
300300
----------------------------------------------
301301

302302
If you have already installed python, you can use one of the

0 commit comments

Comments
 (0)