@@ -409,29 +409,26 @@ C/C++ extensions
409
409
Keyword argument processing
410
410
---------------------------
411
411
412
- Matplotlib makes extensive use of ``**kwargs `` for pass-through
413
- customizations from one function to another. A typical example is in
414
- :func: `matplotlib.pyplot.text `. The definition of the pylab text
415
- function is a simple pass-through to
416
- :meth: `matplotlib.axes.Axes.text `::
412
+ Matplotlib makes extensive use of ``**kwargs `` for pass-through customizations
413
+ from one function to another. A typical example is in `matplotlib.pyplot.text `.
414
+ The definition of the pylab text function is a simple pass-through to
415
+ `matplotlib.axes.Axes.text `::
417
416
418
417
# in pylab.py
419
418
def text(*args, **kwargs):
420
419
ret = gca().text(*args, **kwargs)
421
420
draw_if_interactive()
422
421
return ret
423
422
424
- :meth: `~matplotlib.axes.Axes.text ` in simplified form looks like this,
425
- i.e., it just passes all ``args `` and ``kwargs `` on to
426
- :meth: `matplotlib.text.Text.__init__ `::
423
+ `~matplotlib.axes.Axes.text ` in simplified form looks like this, i.e., it just
424
+ passes all ``args `` and ``kwargs `` on to ``matplotlib.text.Text.__init__ ``::
427
425
428
426
# in axes/_axes.py
429
427
def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
430
428
t = Text(x=x, y=y, text=s, **kwargs)
431
429
432
- and :meth: `~matplotlib.text.Text.__init__ ` (again with liberties for
433
- illustration) just passes them on to the
434
- :meth: `matplotlib.artist.Artist.update ` method::
430
+ and ``matplotlib.text.Text.__init__ `` (again with liberties for illustration)
431
+ just passes them on to the `matplotlib.artist.Artist.update ` method::
435
432
436
433
# in text.py
437
434
def __init__(self, x=0, y=0, text='', **kwargs):
@@ -471,10 +468,10 @@ local arguments and the rest are passed on as
471
468
Using logging for debug messages
472
469
--------------------------------
473
470
474
- Matplotlib uses the standard python `logging ` library to write verbose
475
- warnings, information, and
476
- debug messages. Please use it! In all those places you write :func: ` print() `
477
- statements to do your debugging, try using :func: ` log.debug() ` instead!
471
+ Matplotlib uses the standard Python `logging ` library to write verbose
472
+ warnings, information, and debug messages. Please use it! In all those places
473
+ you write ` print ` calls to do your debugging, try using ` logging.debug `
474
+ instead!
478
475
479
476
480
477
To include `logging ` in your module, at the top of the module, you need to
@@ -489,8 +486,8 @@ To include `logging` in your module, at the top of the module, you need to
489
486
490
487
will log to a logger named ``matplotlib.yourmodulename ``.
491
488
492
- If an end-user of Matplotlib sets up `logging ` to display at levels
493
- more verbose than `logging.WARNING ` in their code with the Matplotlib-provided
489
+ If an end-user of Matplotlib sets up `logging ` to display at levels more
490
+ verbose than `` logging.WARNING ` ` in their code with the Matplotlib-provided
494
491
helper::
495
492
496
493
plt.set_loglevel("debug")
@@ -527,7 +524,7 @@ There are five levels at which you can emit messages.
527
524
steps of layouting or rendering) should only log at this level.
528
525
529
526
By default, `logging ` displays all log messages at levels higher than
530
- `logging.WARNING ` to `sys.stderr `.
527
+ `` logging.WARNING ` ` to `sys.stderr `.
531
528
532
529
The `logging tutorial `_ suggests that the difference between `logging.warning `
533
530
and `.cbook._warn_external ` (which uses `warnings.warn `) is that
@@ -537,11 +534,11 @@ persistent. Moreover, note that `.cbook._warn_external` will by default only
537
534
emit a given warning *once * for each line of user code, whereas
538
535
`logging.warning ` will display the message every time it is called.
539
536
540
- By default, `warnings.warn ` displays the line of code that has the `warn ` call.
541
- This usually isn't more informative than the warning message itself. Therefore,
542
- Matplotlib uses `.cbook._warn_external ` which uses `warnings.warn `, but goes
543
- up the stack and displays the first line of code outside of Matplotlib.
544
- For example, for the module::
537
+ By default, `warnings.warn ` displays the line of code that has the `` warn ``
538
+ call. This usually isn't more informative than the warning message itself.
539
+ Therefore, Matplotlib uses `.cbook._warn_external ` which uses `warnings.warn `,
540
+ but goes up the stack and displays the first line of code outside of
541
+ Matplotlib. For example, for the module::
545
542
546
543
# in my_matplotlib_module.py
547
544
import warnings
@@ -582,10 +579,9 @@ and running the same script will display::
582
579
Writing examples
583
580
----------------
584
581
585
- We have hundreds of examples in subdirectories of
586
- :file: `matplotlib/examples `, and these are automatically generated
587
- when the website is built to show up in the `examples
588
- <../gallery/index.html> ` section of the website.
582
+ We have hundreds of examples in subdirectories of :file: `matplotlib/examples `,
583
+ and these are automatically generated when the website is built to show up in
584
+ the :ref: `examples <gallery >` section of the website.
589
585
590
586
Any sample data that the example uses should be kept small and
591
587
distributed with Matplotlib in the
0 commit comments