# matplotlib/matplotlib

### Subversion checkout URL

You can clone with HTTPS or Subversion.

# Normalize all 'e.g.' instances. Addresses issue #1423.#1916

Merged
merged 3 commits into from
+212 −184

### 5 participants

Collaborator

No description provided.

 cimarronm Normalize all 'e.g.' instances. Addresses issue #1423. 3a8d7f0
doc/users/artists.rst
 @@ -517,7 +517,7 @@ and zooming, as well as the :class:~matplotlib.ticker.Locator and :class:~matplotlib.ticker.Formatter instances which control where the ticks are placed and how they are represented as strings. -Each Axis object contains a :attr:~matplotlib.axis.Axis.label attribute (this is what :mod:~matplotlib.pylab modifies in calls to :func:~matplotlib.pylab.xlabel and :func:~matplotlib.pylab.ylabel) as well as a list of major and minor ticks. The ticks are :class:~matplotlib.axis.XTick and :class:~matplotlib.axis.YTick instances, which contain the actual line and text primitives that render the ticks and ticklabels. Because the ticks are dynamically created as needed (eg. when panning and zooming), you should access the lists of major and minor ticks through their accessor methods :meth:~matplotlib.axis.Axis.get_major_ticks and :meth:~matplotlib.axis.Axis.get_minor_ticks. Although the ticks contain all the primitives and will be covered below, the Axis methods contain accessor methods to return the tick lines, tick labels, tick locations etc.: +Each Axis object contains a :attr:~matplotlib.axis.Axis.label attribute (this is what :mod:~matplotlib.pylab modifies in calls to :func:~matplotlib.pylab.xlabel and :func:~matplotlib.pylab.ylabel) as well as a list of major and minor ticks. The ticks are :class:~matplotlib.axis.XTick and :class:~matplotlib.axis.YTick instances, which contain the actual line and text primitives that render the ticks and ticklabels. Because the ticks are dynamically created as needed (e.g., when panning and zooming), you should access the lists of major and minor ticks through their accessor methods :meth:~matplotlib.axis.Axis.get_major_ticks and :meth:~matplotlib.axis.Axis.get_minor_ticks. Although the ticks contain all the primitives and will be covered below, the Axis methods contain accessor methods to return the tick lines, tick labels, tick locations etc.:
 Collaborator WeatherGod added a note Apr 17, 2013 Whoa, that's a long line I haven't noticed before. Can we get this one broken up, please? to join this conversation on GitHub. Already have an account? Sign in to comment
 cimarronm Reformatted two longs line in artists.rst. e133ace
Collaborator

I have looked through the changes and say that all the changes made were correct (in other words, there are no instances of something being incorrectly identified as something to be converted into 'e.g.,'). As for false negatives, that is a different story. I take it you grepped for the different variations to make this patch?

My only (very minor) concern is if any of these changes pushed the line width past the PEP8 limits. Great work, @cimarronm !

Collaborator

@WeatherGod You are correct. I cannot really say all instances (undoubtedly I probably missed some) but I grepped for quite a few variations of how e.g. was done and then manually corrected them which is why there shouldn't be any false positives; my main emphasis was on not mistakenly making something e.g. which shouldn't have been.

 cimarronm Updated modified lines to ensure linewidth <= 79 according to PEP8. cbabdb2
Collaborator

I wrote a quick awk script to look for anything with line width greater than 79 on the lines I touched and found two (one already over 79 and the other which just got pushed over). Glad you mentioned it. I reformatted those two lines to be compliant.

Collaborator

I'm going to go ahead and merge this PR. Because it touches so many files, I did not want this to go stale. If there are any further actions on these changes, please continue to comment (I've had a look through and haven't found any) and I'm sure @cimarronm would be happy to open a follow-up PR.

Good work @cimarronm!

merged commit 3c5bd38 into from
Collaborator

Closes #1423 .

There seem to be a few cases where a comma was added but is not necessary, e.g. search, e.g., "codex ellipse" which I think should be search, e.g. "codex ellipse". Also, I think that sentences shouldn't start with e.g. but For example. Is there an emojii for pedanticism? ;)

Collaborator

There seem to be a few cases where a comma was added but is not necessary

I was surprised by this too, but apparently it is the "American English" way... http://en.wiktionary.org/wiki/e.g.

@pelson - oh I see. I'm half british so that's probably why it looks wrong ;) The Monty Python would not be happy :-p

Collaborator

Collaborator

I type 'colour' and 'realise' without thinking about it. It's habit. Doesn't mean my coworkers don't slap my wrists :)

referenced this pull request
Merged

### e.g. and i.e. look nicer than eg and ie #3748

Commits on Apr 17, 2013
1. cimarronm authored
2. cimarronm authored
Commits on Apr 18, 2013
1. cimarronm authored
Showing with 212 additions and 184 deletions.
1. +23 −23 CHANGELOG
2. +1 −1  doc/_templates/search.html
3. +9 −9 doc/api/api_changes.rst
4. +5 −5 doc/devel/documenting_mpl.rst
5. +2 −1  doc/devel/gitwash/development_workflow.rst
6. +4 −4 doc/devel/testing.rst
7. +2 −2 doc/faq/howto_faq.rst
8. +1 −1  doc/faq/troubleshooting_faq.rst
9. +1 −1  doc/mpl_toolkits/axes_grid/users/overview.rst
10. +1 −1  doc/sphinxext/gen_rst.py
11. +1 −1  doc/users/annotations_intro.rst
12. +36 −9 doc/users/artists.rst
13. +1 −1  doc/users/event_handling.rst
14. +1 −1  doc/users/mathtext.rst
15. +1 −1  doc/users/recipes.rst
16. +1 −1  doc/users/shell.rst
17. +3 −3 doc/users/transforms_tutorial.rst
18. +3 −3 doc/users/whats_new.rst
19. +1 −1  examples/api/sankey_demo_old.py
20. +1 −1  examples/pylab_examples/barchart_demo2.py
21. +2 −2 examples/pylab_examples/finance_demo.py
22. +1 −1  examples/pylab_examples/image_interp.py
23. +1 −1  examples/pylab_examples/polar_demo.py
24. +1 −1  examples/pylab_examples/set_and_get.py
25. +1 −1  examples/user_interfaces/fourier_demo_wx.py
26. +5 −5 lib/matplotlib/__init__.py
27. +5 −5 lib/matplotlib/afm.py
28. +1 −1  lib/matplotlib/animation.py
29. +11 −11 lib/matplotlib/artist.py
30. +20 −20 lib/matplotlib/axes.py
31. +1 −1  lib/matplotlib/backend_bases.py
32. +4 −4 lib/matplotlib/backends/backend_pdf.py
33. +1 −1  lib/matplotlib/backends/backend_tkagg.py
34. +1 −1  lib/matplotlib/backends/backend_wx.py
35. +1 −1  lib/matplotlib/backends/qt4_editor/formlayout.py
36. +3 −3 lib/matplotlib/collections.py
37. +1 −1  lib/matplotlib/colorbar.py
38. +1 −1  lib/matplotlib/contour.py
40. +3 −3 lib/matplotlib/figure.py
41. +5 −5 lib/matplotlib/font_manager.py
42. +1 −1  lib/matplotlib/legend.py
43. +2 −2 lib/matplotlib/lines.py
44. +4 −4 lib/matplotlib/mathtext.py
45. +5 −5 lib/matplotlib/mlab.py
46. +1 −1  lib/matplotlib/mpl-data/fonts/ttf/RELEASENOTES.TXT
47. +1 −1  lib/matplotlib/patches.py
48. +1 −1  lib/matplotlib/projections/polar.py
49. +5 −5 lib/matplotlib/pyplot.py
50. +1 −1  lib/matplotlib/quiver.py
51. +1 −1  lib/matplotlib/streamplot.py
52. +1 −1  lib/matplotlib/tests/test_colors.py
53. +1 −1  lib/matplotlib/text.py
54. +3 −3 lib/matplotlib/ticker.py
55. +1 −1  lib/matplotlib/tight_layout.py
56. +2 −2 lib/matplotlib/tri/triinterpolate.py
57. +1 −1  lib/matplotlib/tri/triplot.py
58. +2 −2 lib/matplotlib/tri/trirefine.py
59. +2 −2 lib/matplotlib/type1font.py
60. +1 −1  lib/mpl_toolkits/axes_grid/colorbar.py
61. +1 −1  lib/mpl_toolkits/axes_grid1/axes_divider.py
62. +1 −1  lib/mpl_toolkits/axes_grid1/colorbar.py
63. +1 −1  lib/mpl_toolkits/axisartist/floating_axes.py
64. +1 −1  lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py
65. +4 −4 matplotlibrc.template
46 CHANGELOG
 @@ -1036,7 +1036,7 @@ 2009-02-02 Change default resolution on polar plot to 1 - MGD 2009-02-02 Avoid malloc errors in ttconv for fonts that don't have - e.g. PostName (a version of Tahoma triggered this) - JKS + e.g., PostName (a version of Tahoma triggered this) - JKS 2009-01-30 Remove support for pyExcelerator in exceltools -- use xlwt instead - JDH @@ -1110,7 +1110,7 @@ (slanting and extending). - JKS 2008-12-29 Fix a bug in pdf usetex support, which occurred if the same - Type-1 font was used with different encodings, e.g. with + Type-1 font was used with different encodings, e.g., with Minion Pro and MnSymbol. - JKS 2008-12-20 fix the dpi-dependent offset of Shadow. - JJL @@ -1209,7 +1209,7 @@ 2008-12-08 Some of the changes Michael made to improve the output of the property tables in the rest docs broke of made - difficult to use some of the interactive doc helpers, eg + difficult to use some of the interactive doc helpers, e.g., setp and getp. Having all the rest markup in the ipython shell also confused the docstrings. I added a new rc param docstring.harcopy, to format the docstrings differently for @@ -1233,7 +1233,7 @@ 2008-12-05 Fixed a bug that the handlelength of the new legend class set too short when numpoints=1 -JJL -2008-12-04 Added support for data with units (e.g. dates) to +2008-12-04 Added support for data with units (e.g., dates) to Axes.fill_between. -RM 2008-12-04 Added fancybox keyword to legend. Also applied some changes @@ -1314,7 +1314,7 @@ Tollerud and Jae-Joon Lee. - MM 2008-10-11 Fixed bug in pdf backend: if you pass a file object for - output instead of a filename, e.g. in a wep app, we now + output instead of a filename, e.g., in a wep app, we now flush the object at the end. - JKS 2008-10-08 Add path simplification support to paths with gaps. - EF @@ -1527,7 +1527,7 @@ 2008-06-20 Added set/get_closed method to Polygon; fixes error in hist - MM -2008-06-19 Use relative font sizes (e.g. 'medium' and 'large') in +2008-06-19 Use relative font sizes (e.g., 'medium' and 'large') in rcsetup.py and matplotlibrc.template so that text will be scaled by default when changing rcParams['font.size'] - EF @@ -2159,8 +2159,8 @@ 2007-07-31 Refactoring of distutils scripts. - Will not fail on the entire build if an optional Python - package (e.g. Tkinter) is installed but its development - headers are not (e.g. tk-devel). Instead, it will + package (e.g., Tkinter) is installed but its development + headers are not (e.g., tk-devel). Instead, it will continue to build all other extensions. - Provide an overview at the top of the output to display what dependencies and their versions were found, and (by @@ -2192,7 +2192,7 @@ should be changed to ${\cal R}$. Alternatively, you may use the new LaTeX-style font commands (\mathcal, \mathrm, \mathit, \mathtt) which do affect the following group, - eg. $\mathcal{R}$. + e.g., $\mathcal{R}$. Other new features include: @@ -2202,10 +2202,10 @@ - Sub/superscripts are less likely to accidentally overlap. - - Support for sub/superscripts in either order, eg. $x^i_j$ + - Support for sub/superscripts in either order, e.g., $x^i_j$ and $x_j^i$ are equivalent. - - Double sub/superscripts (eg. $x_i_j$) are considered + - Double sub/superscripts (e.g., $x_i_j$) are considered ambiguous and raise an exception. Use braces to disambiguate. - $\frac{x}{y}$ can be used for displaying fractions. @@ -2468,7 +2468,7 @@ color-setting operations in the pdf backend. The idea is that you include the resulting file in another program and set the colors (both stroke and fill color) there, so you - can use the same pdf file for e.g. a paper and a + can use the same pdf file for e.g., a paper and a presentation and have them in the surrounding color. You will probably not want to draw figure and axis frames in that case, since they would be filled in the same color. - JKS @@ -2557,7 +2557,7 @@ frameowrk. Artists will define their own pick method with a configurable epsilon tolerance and return pick attrs. All artists that meet the tolerance threshold will fire a - PickEvent with artist dependent attrs; eg, a Line2D can set + PickEvent with artist dependent attrs; e.g., a Line2D can set the indices attribute that shows the indices into the line that are within epsilon of the pick point. See examples/pick_event_demo.py. The implementation of pick @@ -2667,7 +2667,7 @@ 2006-11-19 Added semi-automatic docstring generation detailing all the kwargs that functions take using the artist introspection - tools; eg 'help text now details the scatter kwargs + tools; e.g., 'help text now details the scatter kwargs that control the Text properties - JDH 2006-11-17 Removed obsolete scatter_classic, leaving a stub to @@ -2957,7 +2957,7 @@ 2006-06-16 Added a pointer to parent in figure canvas so you can access the container with fig.canvas.manager. Useful if - you want to set the window title, eg in gtk + you want to set the window title, e.g., in gtk fig.canvas.manager.window.set_title, though a GUI neutral method would be preferable JDH @@ -3426,7 +3426,7 @@ 2005-12-03 Modified scipy patch to support Numeric, scipy and numarray Some work remains to be done because some of the scipy - imports are broken if only the core is installed. Eg + imports are broken if only the core is installed. e.g., apparently we need from scipy.basic.fftpack import * rather than from scipy.fftpack import * @@ -3675,7 +3675,7 @@ 2005-07-06 Made HOME/.matplotlib the new config dir where the matplotlibrc file, the ttf.cache, and the tex.cache live. The new default filenames in .matplotlib have no leading - dot and are not hidden. Eg, the new names are matplotlibrc + dot and are not hidden. e.g., the new names are matplotlibrc tex.cache ttffont.cache. This is how ipython does it so it must be right. If old files are found, a warning is issued and they are moved to the new location. Also fixed @@ -3949,7 +3949,7 @@ 2005-04-11 Applied a variant of rick's xlim/ylim/axis patch. These functions now take kwargs to let you selectively alter only - the min or max if desired. Eg xlim(xmin=2) or + the min or max if desired. e.g., xlim(xmin=2) or axis(ymax=3). They always return the new lim. - JDH @@ -4078,7 +4078,7 @@ 2005-02-23 Added rc param ps.useafm so backend ps can use native afm fonts or truetype. afme breaks mathtext but causes much smaller font sizes and may result in images that display - better in some contexts (eg pdfs incorporated into latex + better in some contexts (e.g., pdfs incorporated into latex docs viewed in acrobat reader). I would like to extend this approach to allow the user to use truetype only for mathtext, which should be easy. @@ -4206,9 +4206,9 @@ 2005-01-18 Added accents to mathtext: \hat, \breve, \grave, \bar, \acute, \tilde, \vec, \dot, \ddot. All of them have the - same syntax, eg to make an overbar you do \bar{o} or to + same syntax, e.g., to make an overbar you do \bar{o} or to make an o umlaut you do \ddot{o}. The shortcuts are also - provided, eg: \"o \'e \e \~n \.x \^y - JDH + provided, e.g., \"o \'e \e \~n \.x \^y - JDH 2005-01-18 Plugged image resize memory leaks - JDH @@ -4375,7 +4375,7 @@ 2004-12-04 Fixed some legend bugs JDH -2004-11-30 Added over command for oneoff over plots. Eg over(plot, x, +2004-11-30 Added over command for oneoff over plots. e.g., over(plot, x, y, lw=2). Works with any plot function. 2004-11-30 Added bbox property to text - JDH @@ -4551,7 +4551,7 @@ 2004-09-17 Added coords formatter attributes. These must be callable, and return a string for the x or y data. These will be used to format the x and y data for the coords box. Default is - the axis major formatter. Eg + the axis major formatter. e.g.: # format the coords message box def price(x): return '$%1.2f'%x 2  doc/_templates/search.html  @@ -10,7 +10,7 @@ {{ _('Search') }} words. Pages containing less words won't appear in the result list.{% endtrans %} If you want to limit your search to working code examples, include the keyword "codex" (mnemonic for code example) in your - search, eg "codex ellipse"; + search, e.g., "codex ellipse"; see search examples. 18 doc/api/api_changes.rst  @@ -357,7 +357,7 @@ Changes in 0.99 * Axes instances no longer have a "frame" attribute. Instead, use the new "spines" attribute. Spines is a dictionary where the keys are - the names of the spines (e.g. 'left','right' and so on) and the + the names of the spines (e.g., 'left','right' and so on) and the values are the artists that draw the spines. For normal (rectilinear) axes, these artists are Line2D instances. For other axes (such as polar axes), these artists may be Patch instances. @@ -549,7 +549,7 @@ The view intervals are now stored only in one place -- in the as well. This means locators must get their limits from their :class:matplotlib.axis.Axis, which in turn looks up its limits from the :class:~matplotlib.axes.Axes. If a locator is used temporarily -and not assigned to an Axis or Axes, (e.g. in +and not assigned to an Axis or Axes, (e.g., in :mod:matplotlib.contour), a dummy axis must be created to store its bounds. Call :meth:matplotlib.ticker.Locator.create_dummy_axis to do so. @@ -844,7 +844,7 @@ Changes for 0.91.0 fonts. Currently it simply reads pfa and pfb format files and stores the data in a way that is suitable for embedding in pdf files. In the future the class might actually parse the font to - allow e.g. subsetting. + allow e.g., subsetting. * :mod:matplotlib.FT2Font now supports :meth:FT_Attach_File. In practice this can be used to read an afm file in addition to a @@ -864,7 +864,7 @@ Changes for 0.91.0 should be changed to ${\cal R}$. Alternatively, you may use the new LaTeX-style font commands (\mathcal, \mathrm, \mathit, \mathtt) which do affect the following group, - eg. $\mathcal{R}$. + e.g., $\mathcal{R}$. * Text creation commands have a new default linespacing and a new linespacing kwarg, which is a multiple of the maximum vertical @@ -935,7 +935,7 @@ Changes for 0.90.1 Barh now takes a **kwargs dict instead of most of the old arguments. This helps ensure that bar and barh are kept in sync, - but as a side effect you can no longer pass e.g. color as a + but as a side effect you can no longer pass e.g., color as a positional argument. ft2font.get_charmap() now returns a dict that maps character codes @@ -1178,7 +1178,7 @@ Changes for 0.83 - Made HOME/.matplotlib the new config dir where the matplotlibrc file, the ttf.cache, and the tex.cache live. The new default filenames in .matplotlib have no leading dot and are not hidden. - Eg, the new names are matplotlibrc, tex.cache, and ttffont.cache. + e.g., the new names are matplotlibrc, tex.cache, and ttffont.cache. This is how ipython does it so it must be right. If old files are found, a warning is issued and they are moved to @@ -1447,7 +1447,7 @@ Changes for 0.63 Most of the date tick locators have a different meaning in their constructors. In the prior implementation, the first argument was a - base and multiples of the base were ticked. Eg + base and multiples of the base were ticked. e.g., HourLocator(5) # old: tick every 5 minutes @@ -1625,7 +1625,7 @@ Bounding boxes bbox = clickBBox = lbwh_to_bbox(left, bottom, width, height) - The Bbox has a different API than the Bound2D. Eg, if you want to + The Bbox has a different API than the Bound2D. e.g., if you want to get the width and height of the bbox OLD:: @@ -1773,7 +1773,7 @@ Changes for 0.50 There is one important API change for application developers. Figure instances used subclass GUI widgets that enabled them to be - placed directly into figures. Eg, FigureGTK subclassed + placed directly into figures. e.g., FigureGTK subclassed gtk.DrawingArea. Now the Figure class is independent of the backend, and FigureCanvas takes over the functionality formerly handled by Figure. In order to include figures into your apps, 10 doc/devel/documenting_mpl.rst  @@ -62,7 +62,7 @@ method in the :class:~matplotlib.artist.Artist class. Yes, this is not ideal given python properties or enthought traits, but it is a historical legacy for now. The setter methods use the docstring with the ACCEPTS token to indicate the type of argument the method accepts. -Eg. in :class:matplotlib.lines.Line2D:: +e.g., in :class:matplotlib.lines.Line2D:: # in lines.py def set_linestyle(self, linestyle): @@ -72,7 +72,7 @@ Eg. in :class:matplotlib.lines.Line2D:: ACCEPTS: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' | ' ' | '' ] """ -Since matplotlib uses a lot of pass-through kwargs, eg. in every +Since matplotlib uses a lot of pass-through kwargs, e.g., in every function that creates a line (:func:~matplotlib.pyplot.plot, :func:~matplotlib.pyplot.semilogx, :func:~matplotlib.pyplot.semilogy, etc...), it can be difficult for @@ -98,7 +98,7 @@ docstring of kwargs. Here is an example from artist.kwdocd['Line2D'] = artist.kwdoc(Line2D) Then in any function accepting :class:~matplotlib.lines.Line2D -pass-through kwargs, eg. :meth:matplotlib.axes.Axes.plot:: +pass-through kwargs, e.g., :meth:matplotlib.axes.Axes.plot:: # in axes.py def plot(self, *args, **kwargs): @@ -117,7 +117,7 @@ pass-through kwargs, eg. :meth:matplotlib.axes.Axes.plot:: plot.__doc__ = cbook.dedent(plot.__doc__) % artist.kwdocd Note there is a problem for :class:~matplotlib.artist.Artist -__init__ methods, eg. :meth:matplotlib.patches.Patch.__init__, +__init__ methods, e.g., :meth:matplotlib.patches.Patch.__init__, which supports Patch kwargs, since the artist inspector cannot work until the class is fully defined and we can't modify the Patch.__init__.__doc__ docstring outside the class definition. @@ -360,7 +360,7 @@ Referring to mpl documents ========================== In the documentation, you may want to include to a document in the -matplotlib src, e.g. a license file or an image file from mpl-data, +matplotlib src, e.g., a license file or an image file from mpl-data, refer to it via a relative path from the document where the rst file resides, eg, in :file:users/navigation_toolbar.rst, we refer to the image icons with:: 3  doc/devel/gitwash/development_workflow.rst  @@ -106,7 +106,8 @@ In more detail Asking for code review ====================== -#. Go to your repo URL |emdash| e.g. http://github.com/your-user-name/matplotlib. +#. Go to your repo URL |emdash| e.g., + http://github.com/your-user-name/matplotlib. #. Click on the *Branch list* button: .. image:: branch_list.png 8 doc/devel/testing.rst  @@ -38,7 +38,7 @@ The script can take any of the usual nosetest arguments_, such as To run a single test from the command line, you can provide a dot-separated path to the module followed by the function separated by -a colon, eg. (this is assuming the test is installed):: +a colon, e.g., (this is assuming the test is installed):: python tests.py matplotlib.tests.test_simplification:test_clipping @@ -182,8 +182,8 @@ Using tox Tox _ is a tool for running tests against multiple Python environments, including multiple versions of Python -(e.g.: 2.6, 2.7, 3.2, etc.) and even different Python implementations -altogether (e.g.: CPython, PyPy, Jython, etc.) +(e.g., 2.6, 2.7, 3.2, etc.) and even different Python implementations +altogether (e.g., CPython, PyPy, Jython, etc.) Testing all 4 versions of Python (2.6, 2.7, 3.1, and 3.2) requires having four versions of Python installed on your system and on the @@ -215,7 +215,7 @@ parallelized version of tox called detox. Give this a try:$ detox Tox is configured using a file called tox.ini. You may need to -edit this file if you want to add new environments to test (e.g.: +edit this file if you want to add new environments to test (e.g., py33) or if you want to tweak the dependencies or the way the tests are run. For more info on the tox.ini file, see the Tox Configuration Specification
4 doc/faq/howto_faq.rst
 @@ -55,7 +55,7 @@ the alpha properties directly. The figure has a :class:~matplotlib.patches.Rectangle instance called *patch* and the axes has a Rectangle instance called *patch*. You can set any property on them directly (*facecolor*, *edgecolor*, *linewidth*, -*linestyle*, *alpha*). Eg:: +*linestyle*, *alpha*). e.g.:: fig = plt.figure() fig.patch.set_alpha(0.5) @@ -64,7 +64,7 @@ any property on them directly (*facecolor*, *edgecolor*, *linewidth*, If you need *all* the figure elements to be transparent, there is currently no global alpha setting, but you can set the alpha channel -on individual elements, eg:: +on individual elements, e.g.:: ax.plot(x, y, alpha=0.5) ax.set_xlabel('volts', alpha=0.5)
2  doc/faq/troubleshooting_faq.rst
 @@ -86,7 +86,7 @@ please provide the following information in your e-mail to the python -c import matplotlib; print matplotlib.__version__ - * where you obtained matplotlib (e.g. your Linux distribution's + * where you obtained matplotlib (e.g., your Linux distribution's packages or the matplotlib Sourceforge site, or the enthought python distribution EPD _).
2  doc/mpl_toolkits/axes_grid/users/overview.rst
 @@ -114,7 +114,7 @@ AxesGrid takes following arguments, ============= ======== ================================================ fig rect - nrows_ncols number of rows and cols. e.g. (2,2) + nrows_ncols number of rows and cols. e.g., (2,2) ngrids None number of grids. nrows x ncols if None direction "row" increasing direction of axes number. [row|column] axes_pad 0.02 pad between axes in inches
2  doc/sphinxext/gen_rst.py
 @@ -15,7 +15,7 @@ def out_of_date(original, derived): Returns True if derivative is out-of-date wrt original, both of which are full file paths. - TODO: this check isn't adequate in some cases. Eg, if we discover + TODO: this check isn't adequate in some cases. e.g., if we discover a bug when building the examples, the original and derived will be unchanged but we still want to force a rebuild. """
2  doc/users/annotations_intro.rst
 @@ -66,7 +66,7 @@ shrink move the tip and base some percent away from the annotated point and text \*\*kwargs any key for :class:matplotlib.patches.Polygon, - e.g. facecolor + e.g., facecolor ==================== =====================================================
45 doc/users/artists.rst
 @@ -19,8 +19,24 @@ the Artist handles all the high level constructs like representing and laying out the figure, text, and lines. The typical user will spend 95% of his time working with the Artists. -There are two types of Artists: primitives and containers. The primitives represent the standard graphical objects we want to paint onto our canvas: :class:~matplotlib.lines.Line2D, :class:~matplotlib.patches.Rectangle, :class:~matplotlib.text.Text, :class:~matplotlib.image.AxesImage, etc., and the containers are places to put them (:class:~matplotlib.axis.Axis, :class:~matplotlib.axes.Axes and :class:~matplotlib.figure.Figure). The standard use is to create a :class:~matplotlib.figure.Figure instance, use the Figure to create one or more :class:~matplotlib.axes.Axes or :class:~matplotlib.axes.Subplot instances, and use the Axes instance helper methods to create the primitives. In the example below, we create a Figure instance using :func:matplotlib.pyplot.figure, which is a convenience method for instantiating Figure instances and connecting them with your user interface or drawing toolkit FigureCanvas. As we will discuss below, this is not necessary -- you -can work directly with PostScript, PDF Gtk+, or wxPython FigureCanvas instances, instantiate your Figures directly and connect them yourselves -- but since we are focusing here on the Artist API we'll let :mod:~matplotlib.pyplot handle some of those details for us:: +There are two types of Artists: primitives and containers. The primitives +represent the standard graphical objects we want to paint onto our canvas: +:class:~matplotlib.lines.Line2D, :class:~matplotlib.patches.Rectangle, +:class:~matplotlib.text.Text, :class:~matplotlib.image.AxesImage, etc., and +the containers are places to put them (:class:~matplotlib.axis.Axis, +:class:~matplotlib.axes.Axes and :class:~matplotlib.figure.Figure). The +standard use is to create a :class:~matplotlib.figure.Figure instance, use +the Figure to create one or more :class:~matplotlib.axes.Axes or +:class:~matplotlib.axes.Subplot instances, and use the Axes instance +helper methods to create the primitives. In the example below, we create a +Figure instance using :func:matplotlib.pyplot.figure, which is a +convenience method for instantiating Figure instances and connecting them +with your user interface or drawing toolkit FigureCanvas. As we will +discuss below, this is not necessary -- you can work directly with PostScript, +PDF Gtk+, or wxPython FigureCanvas instances, instantiate your Figures +directly and connect them yourselves -- but since we are focusing here on the +Artist API we'll let :mod:~matplotlib.pyplot handle some of those details +for us:: import matplotlib.pyplot as plt fig = plt.figure() @@ -38,8 +54,8 @@ graphics primitives (:class:~matplotlib.lines.Line2D, :class:~matplotlib.text.Text, :class:~matplotlib.patches.Rectangle, :class:~matplotlib.image.Image, respectively). These helper methods -will take your data (eg. numpy arrays and strings) and create -primitive Artist instances as needed (eg. Line2D), add them to +will take your data (e.g., numpy arrays and strings) and create +primitive Artist instances as needed (e.g., Line2D), add them to the relevant containers, and draw them when requested. Most of you are probably familiar with the :class:~matplotlib.axes.Subplot, which is just a special case of an Axes that lives on a regular @@ -136,7 +152,7 @@ transparency, and other properties of the Axes. These instances are stored as member variables :attr:Figure.patch  and :attr:Axes.patch  ("Patch" is a name inherited from -MATLAB, and is a 2D "patch" of color on the figure, eg. rectangles, +MATLAB, and is a 2D "patch" of color on the figure, e.g., rectangles, circles and polygons). Every matplotlib Artist has the following properties @@ -151,7 +167,7 @@ clip_on Whether clipping is enabled clip_path The path the artist is clipped to contains A picking function to test whether the artist contains the pick point figure The figure instance the artist lives in, possibly None -label A text label (eg. for auto-labeling) +label A text label (e.g., for auto-labeling) picker A python object that controls object picking transform The transformation visible A boolean whether the artist should be drawn @@ -176,7 +192,7 @@ inspect the Artist properties is to use the :func:matplotlib.artist.getp function (simply :func:~matplotlib.pylab.getp in pylab), which lists the properties and their values. This works for classes derived from Artist as -well, eg. Figure and Rectangle. Here are the Figure rectangle +well, e.g., Figure and Rectangle. Here are the Figure rectangle properties mentioned above: .. sourcecode:: ipython @@ -346,7 +362,7 @@ determines the shape, background and border of the plotting region:: rect = ax.patch # a Rectangle instance rect.set_facecolor('green') -When you call a plotting method, eg. the canonical +When you call a plotting method, e.g., the canonical :meth:~matplotlib.axes.Axes.plot and pass in arrays or lists of values, the method will create a :meth:matplotlib.lines.Line2D instance, update the line with all the Line2D properties passed as @@ -517,7 +533,18 @@ and zooming, as well as the :class:~matplotlib.ticker.Locator and :class:~matplotlib.ticker.Formatter instances which control where the ticks are placed and how they are represented as strings. -Each Axis object contains a :attr:~matplotlib.axis.Axis.label attribute (this is what :mod:~matplotlib.pylab modifies in calls to :func:~matplotlib.pylab.xlabel and :func:~matplotlib.pylab.ylabel) as well as a list of major and minor ticks. The ticks are :class:~matplotlib.axis.XTick and :class:~matplotlib.axis.YTick instances, which contain the actual line and text primitives that render the ticks and ticklabels. Because the ticks are dynamically created as needed (eg. when panning and zooming), you should access the lists of major and minor ticks through their accessor methods :meth:~matplotlib.axis.Axis.get_major_ticks and :meth:~matplotlib.axis.Axis.get_minor_ticks. Although the ticks contain all the primitives and will be covered below, the Axis methods contain accessor methods to return the tick lines, tick labels, tick locations etc.: +Each Axis object contains a :attr:~matplotlib.axis.Axis.label attribute +(this is what :mod:~matplotlib.pylab modifies in calls to +:func:~matplotlib.pylab.xlabel and :func:~matplotlib.pylab.ylabel) as well +as a list of major and minor ticks. The ticks are +:class:~matplotlib.axis.XTick and :class:~matplotlib.axis.YTick instances, +which contain the actual line and text primitives that render the ticks and +ticklabels. Because the ticks are dynamically created as needed (e.g., when +panning and zooming), you should access the lists of major and minor ticks +through their accessor methods :meth:~matplotlib.axis.Axis.get_major_ticks +and :meth:~matplotlib.axis.Axis.get_minor_ticks. Although the ticks contain +all the primitives and will be covered below, the Axis methods contain +accessor methods to return the tick lines, tick labels, tick locations etc.: .. sourcecode:: ipython
2  doc/users/event_handling.rst
 @@ -444,7 +444,7 @@ There are a variety of meanings of the picker property: After you have enabled an artist for picking by setting the picker property, you need to connect to the figure canvas pick_event to get -pick callbacks on mouse press events. Eg:: +pick callbacks on mouse press events. e.g.:: def pick_handler(event): mouseevent = event.mouseevent
2  doc/users/mathtext.rst
 @@ -46,7 +46,7 @@ produces ":math:\alpha > \beta". .. note:: Mathtext should be placed between a pair of dollar signs ($). To - make it easy to display monetary values, e.g. "$100.00", if a + make it easy to display monetary values, e.g., "\$100.00", if a single dollar sign is present in the entire string, it will be displayed verbatim as a dollar sign. This is a small change from regular TeX, where the dollar sign in non-math text would have to
2  doc/users/recipes.rst
 @@ -40,7 +40,7 @@ Easily creating subplots In early versions of matplotlib, if you wanted to use the pythonic API and create a figure instance and from that create a grid of subplots, possibly with shared axes, it involved a fair amount of boilerplate -code. Eg +code. e.g. .. sourcecode:: python
2  doc/users/shell.rst
 @@ -66,7 +66,7 @@ Other python interpreters ========================= If you can't use ipython, and still want to use matplotlib/pylab from -an interactive python shell, e.g. the plain-ole standard python +an interactive python shell, e.g., the plain-ole standard python interactive interpreter, you are going to need to understand what a matplotlib backend is :ref:what-is-a-backend.
6 doc/users/transforms_tutorial.rst
 @@ -161,7 +161,7 @@ your axes or subplot, (0.5, 0.5) is the center, and (1.0, 1.0) is the top right. You can also refer to points outside the range, so (-0.1, 1.1) is to the left and above your axes. This coordinate system is extremely useful when placing text in your axes, because you often -want a text bubble in a fixed, location, eg. the upper left of the axes +want a text bubble in a fixed, location, e.g., the upper left of the axes pane, and have that location remain fixed when you pan or zoom. Here is a simple example that creates four panels and labels them 'A', 'B', 'C', 'D' as you often see in journals. @@ -419,7 +419,7 @@ and we can use this same inverted transformation to go from the unit Out[90]: array([ 2.5, -0.5]) The final piece is the self.transScale attribute, which is -responsible for the optional non-linear scaling of the data, eg. for +responsible for the optional non-linear scaling of the data, e.g., for logarithmic axes. When an Axes is initially setup, this is just set to the identity transform, since the basic matplotlib axes has linear scale, but when you call a logarithmic scaling function like @@ -441,7 +441,7 @@ the typical separable matplotlib Axes, with one additional piece (self.transProjectionAffine + self.transAxes) transProjection handles the projection from the space, -eg. latitude and longitude for map data, or radius and theta for polar +e.g., latitude and longitude for map data, or radius and theta for polar data, to a separable Cartesian coordinate system. There are several projection examples in the matplotlib.projections package, and the best way to learn more is to open the source for those packages and
6 doc/users/whats_new.rst
 @@ -558,7 +558,7 @@ Fernando Perez got tired of all the boilerplate code needed to create a figure and multiple subplots when using the matplotlib API, and wrote a :func:~matplotlib.pyplot.subplots helper function. Basic usage allows you to create the figure and an array of subplots with numpy -indexing (starts with 0). Eg:: +indexing (starts with 0). e.g.:: fig, axarr = plt.subplots(2, 2) axarr[0,0].plot([1,2,3]) # upper, left @@ -836,7 +836,7 @@ Here are the 0.98.4 notes from the CHANGELOG:: Fixed a bug that the handlelength of the new legend class set too short when numpoints=1 -JJL - Added support for data with units (e.g. dates) to + Added support for data with units (e.g., dates) to Axes.fill_between. -RM Added fancybox keyword to legend. Also applied some changes for @@ -913,7 +913,7 @@ Here are the 0.98.4 notes from the CHANGELOG:: Jae-Joon Lee. - MM Fixed bug in pdf backend: if you pass a file object for output - instead of a filename, e.g. in a wep app, we now flush the object + instead of a filename, e.g., in a wep app, we now flush the object at the end. - JKS Add path simplification support to paths with gaps. - EF
2  examples/api/sankey_demo_old.py
 @@ -24,7 +24,7 @@ def sankey(ax, w: output arrow shoulder inangle: input dip angle offset: text offset - **kwargs: propagated to Patch (e.g. fill=False) + **kwargs: propagated to Patch (e.g., fill=False) Return (patch,[intexts,outtexts]). """
2  examples/pylab_examples/barchart_demo2.py
 @@ -81,7 +81,7 @@ def withnew(i, scr): width = int(rect.get_width()) # Figure out what the last digit (width modulo 10) so we can add - # the appropriate numerical suffix (e.g. 1st, 2nd, 3rd, etc) + # the appropriate numerical suffix (e.g., 1st, 2nd, 3rd, etc) lastDigit = width % 10 # Note that 11, 12, and 13 are special cases if (width == 11) or (width == 12) or (width == 13):
4 examples/pylab_examples/finance_demo.py
 @@ -12,8 +12,8 @@ mondays = WeekdayLocator(MONDAY) # major ticks on the mondays alldays = DayLocator() # minor ticks on the days -weekFormatter = DateFormatter('%b %d') # Eg, Jan 12 -dayFormatter = DateFormatter('%d') # Eg, 12 +weekFormatter = DateFormatter('%b %d') # e.g., Jan 12 +dayFormatter = DateFormatter('%d') # e.g., 12 quotes = quotes_historical_yahoo('INTC', date1, date2) if len(quotes) == 0:
2  examples/pylab_examples/image_interp.py
 @@ -15,7 +15,7 @@ matplotlib._image module which takes advantage of this fix, no longer makes this necessary. To prevent edge effects, when doing interpolation, the matplotlib._image module now pads the input array -with identical pixels around the edge. Eg, if you have a 5x5 array +with identical pixels around the edge. e.g., if you have a 5x5 array with colors a-y as below
2  examples/pylab_examples/polar_demo.py
 @@ -17,7 +17,7 @@ # axes([left, bottom, width, height], polar=True) # # The view limits (eg xlim and ylim) apply to the lower left and upper -# right of the rectangular box that surrounds to polar axes. Eg if +# right of the rectangular box that surrounds to polar axes. e.g., if # you have # # r = arange(0,1,0.01)
2  examples/pylab_examples/set_and_get.py
 @@ -23,7 +23,7 @@ set operates on a single instance or a list of instances. If you are in query mode introspecting the possible values, only the first instance in the sequence is used. When actually setting values, all - the instances will be set. Eg, suppose you have a list of two lines, + the instances will be set. e.g., suppose you have a list of two lines, the following will make both lines thicker and red >>> x = arange(0,1.0,0.01)
2  examples/user_interfaces/fourier_demo_wx.py
 @@ -12,7 +12,7 @@ class Knob: """ Knob - simple class with a "setKnob" method. - A Knob instance is attached to a Param instance, e.g. param.attach(knob) + A Knob instance is attached to a Param instance, e.g., param.attach(knob) Base class is for documentation purposes. """ def setKnob(self, value):
10 lib/matplotlib/__init__.py
 @@ -2,7 +2,7 @@ This is an object-oriented plotting library. A procedural interface is provided by the companion pyplot module, -which may be imported directly, e.g:: +which may be imported directly, e.g.:: from matplotlib.pyplot import * @@ -910,10 +910,10 @@ def rc_params_from_file(fname, fail_on_error=False): def rc(group, **kwargs): """ - Set the current rc params. Group is the grouping for the rc, eg. + Set the current rc params. Group is the grouping for the rc, e.g., for lines.linewidth the group is lines, for axes.facecolor, the group is axes, and so on. Group may - also be a list or tuple of group names, eg. (*xtick*, *ytick*). + also be a list or tuple of group names, e.g., (*xtick*, *ytick*). *kwargs* is a dictionary attribute name/value pairs, eg:: rc('lines', linewidth=2, color='r') @@ -944,7 +944,7 @@ def rc(group, **kwargs): Note you can use python's kwargs dictionary facility to store - dictionaries of default parameters. Eg, you can customize the + dictionaries of default parameters. e.g., you can customize the font rc as follows:: font = {'family' : 'monospace', @@ -1065,7 +1065,7 @@ def use(arg, warn=True, force=False): is issued if you try and call this after pylab or pyplot have been loaded. In certain black magic use cases, e.g. :func:pyplot.switch_backend, we are doing the reloading necessary to - make the backend switch work (in some cases, e.g. pure image + make the backend switch work (in some cases, e.g., pure image backends) so one can set warn=False to suppress the warnings. To find out which backend is currently set, see
10 lib/matplotlib/afm.py
 @@ -103,7 +103,7 @@ def _parse_header(fh): """ Reads the font metrics header (up to the char metrics) and returns a dictionary mapping *key* to *val*. *val* will be converted to the - appropriate python type as necessary; eg: + appropriate python type as necessary; e.g.: * 'False'->False * '0'->0 @@ -496,18 +496,18 @@ def get_kern_dist_from_name(self, name1, name2): return 0 def get_fontname(self): - "Return the font name, eg, 'Times-Roman'" + "Return the font name, e.g., 'Times-Roman'" return self._header[b'FontName'] def get_fullname(self): - "Return the font full name, eg, 'Times-Roman'" + "Return the font full name, e.g., 'Times-Roman'" name = self._header.get(b'FullName') if name is None: # use FontName as a substitute name = self._header[b'FontName'] return name def get_familyname(self): - "Return the font family name, eg, 'Times'" + "Return the font family name, e.g., 'Times'" name = self._header.get(b'FamilyName') if name is not None: return name @@ -518,7 +518,7 @@ def get_familyname(self): return re.sub(extras, '', name) def get_weight(self): - "Return the font weight, eg, 'Bold' or 'Roman'" + "Return the font weight, e.g., 'Bold' or 'Roman'" return self._header[b'Weight'] def get_angle(self):
2  lib/matplotlib/animation.py
 @@ -576,7 +576,7 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None, ''' Saves a movie file by drawing every frame. - *filename* is the output filename, eg :file:mymovie.mp4 + *filename* is the output filename, e.g., :file:mymovie.mp4 *writer* is either an instance of :class:MovieWriter or a string key that identifies a class to use, such as 'ffmpeg' or 'mencoder'.
22 lib/matplotlib/artist.py
 @@ -345,7 +345,7 @@ def pick(self, mouseevent): ax = getattr(a, 'axes', None) if mouseevent.inaxes is None or mouseevent.inaxes == ax: # we need to check if mouseevent.inaxes is None - # because some objects associated with an axes (eg a + # because some objects associated with an axes (e.g., a # tick label) can be outside the bounding box of the # axes and inaxes will be None a.pick(mouseevent) @@ -367,7 +367,7 @@ def set_picker(self, picker): off an event if it's data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event - that is generated, e.g. the indices of the data within + that is generated, e.g., the indices of the data within epsilon of the pick event * A function: if picker is callable, it is a user supplied @@ -765,7 +765,7 @@ def findobj(self, match=None, include_self=True): - function with signature boolean = match(artist) used to filter matches - - class instance: eg Line2D. Only return artists of class type. + - class instance: e.g., Line2D. Only return artists of class type. If *include_self* is True (default), include self in the list to be checked for a match. @@ -828,7 +828,7 @@ def get_aliases(self): Get a dict mapping *fullname* -> *alias* for each *alias* in the :class:~matplotlib.artist.ArtistInspector. - Eg., for lines:: + e.g., for lines:: {'markerfacecolor': 'mfc', 'linewidth' : 'lw', @@ -858,7 +858,7 @@ def get_valid_values(self, attr): This is done by querying the docstring of the function *set_attr* for a line that begins with ACCEPTS: - Eg., for a line linestyle, return + e.g., for a line linestyle, return "[ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]" """ @@ -905,7 +905,7 @@ def _get_setters_and_targets(self): def get_setters(self): """ - Get the attribute strings with setters for object. Eg., for a line, + Get the attribute strings with setters for object. e.g., for a line, return ['markerfacecolor', 'linewidth', ....]. """ @@ -926,7 +926,7 @@ def aliased_name(self, s): return 'PROPNAME or alias' if *s* has an alias, else return PROPNAME. - E.g. for the line markerfacecolor property, which has an + e.g., for the line markerfacecolor property, which has an alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform' """ @@ -943,7 +943,7 @@ def aliased_name_rest(self, s, target): return 'PROPNAME or alias' if *s* has an alias, else return PROPNAME formatted for ReST - E.g. for the line markerfacecolor property, which has an + e.g., for the line markerfacecolor property, which has an alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform' """ @@ -1092,7 +1092,7 @@ def findobj(self, match=None): - function with signature boolean = match(artist) - - class instance: eg :class:~matplotlib.lines.Line2D + - class instance: e.g., :class:~matplotlib.lines.Line2D used to filter matches. """ @@ -1134,7 +1134,7 @@ def getp(obj, property=None): getp(obj) # get all the object properties getp(obj, 'linestyle') # get the linestyle property - *obj* is a :class:Artist instance, eg + *obj* is a :class:Artist instance, e.g., :class:~matplotllib.lines.Line2D or an instance of a :class:~matplotlib.axes.Axes or :class:matplotlib.text.Text. If the *property* is 'somename', this function returns @@ -1192,7 +1192,7 @@ def setp(obj, *args, **kwargs): :func:setp operates on a single instance or a list of instances. If you are in query mode introspecting the possible values, only the first instance in the sequence is used. When actually setting - values, all the instances will be set. E.g., suppose you have a + values, all the instances will be set. e.g., suppose you have a list of two lines, the following will make both lines thicker and red::
40 lib/matplotlib/axes.py
 @@ -551,7 +551,7 @@ def _set_lim_and_transforms(self): # Transforms the x and y axis separately by a scale factor. # It is assumed that this part will have non-linear components - # (e.g. for a log scale). + # (e.g., for a log scale). self.transScale = mtransforms.TransformWrapper( mtransforms.IdentityTransform()) @@ -1935,7 +1935,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True): x0, x1 = bb.intervalx xlocator = self.xaxis.get_major_locator() try: - # e.g. DateLocator has its own nonsingular() + # e.g., DateLocator has its own nonsingular() x0, x1 = xlocator.nonsingular(x0, x1) except AttributeError: # Default nonsingular for, e.g., MaxNLocator @@ -2342,7 +2342,7 @@ def tick_params(self, axis='both', **kwargs): Distance in points between tick and label. *labelsize* - Tick label font size in points or as a string (e.g. 'large'). + Tick label font size in points or as a string (e.g., 'large'). *labelcolor* Tick label color; mpl color spec. @@ -3344,7 +3344,7 @@ def text(self, x, y, s, fontdict=None, >>> verticalalignment='center', >>> transform = ax.transAxes) - You can put a rectangular box around the text instance (eg. to + You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword *bbox*. *bbox* is a dictionary of ~matplotlib.patches.Rectangle properties. For example:: @@ -3424,14 +3424,14 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs): Draw a horizontal line at *y* from *xmin* to *xmax*. With the default values of *xmin* = 0 and *xmax* = 1, this line will always span the horizontal extent of the axes, regardless of - the xlim settings, even if you change them, eg. with the + the xlim settings, even if you change them, e.g., with the :meth:set_xlim command. That is, the horizontal extent is in axes coords: 0=left, 0.5=middle, 1.0=right but the *y* location is in data coordinates. Return value is the :class:~matplotlib.lines.Line2D instance. kwargs are the same as kwargs to plot, and can be - used to control the line properties. Eg., + used to control the line properties. e.g., * draw a thick red hline at *y* = 0 that spans the xrange:: @@ -3488,14 +3488,14 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs): Draw a vertical line at *x* from *ymin* to *ymax*. With the default values of *ymin* = 0 and *ymax* = 1, this line will always span the vertical extent of the axes, regardless of the - ylim settings, even if you change them, eg. with the + ylim settings, even if you change them, e.g., with the :meth:set_ylim command. That is, the vertical extent is in axes coords: 0=bottom, 0.5=middle, 1.0=top but the *x* location is in data coordinates. Return value is the :class:~matplotlib.lines.Line2D instance. kwargs are the same as kwargs to plot, and can be - used to control the line properties. Eg., + used to control the line properties. e.g., * draw a thick red vline at *x* = 0 that spans the yrange:: @@ -3555,7 +3555,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs): Draw a horizontal span (rectangle) from *ymin* to *ymax*. With the default values of *xmin* = 0 and *xmax* = 1, this always spans the xrange, regardless of the xlim settings, even - if you change them, eg. with the :meth:set_xlim command. + if you change them, e.g., with the :meth:set_xlim command. That is, the horizontal extent is in axes coords: 0=left, 0.5=middle, 1.0=right but the *y* location is in data coordinates. @@ -3611,7 +3611,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs): Draw a vertical span (rectangle) from *xmin* to *xmax*. With the default values of *ymin* = 0 and *ymax* = 1, this always spans the yrange, regardless of the ylim settings, even if you - change them, eg. with the :meth:set_ylim command. That is, + change them, e.g., with the :meth:set_ylim command. That is, the vertical extent is in axes coords: 0=bottom, 0.5=middle, 1.0=top but the *y* location is in data coordinates. @@ -4713,7 +4713,7 @@ def legend(self, *args, **kwargs): Padding and spacing between various elements use following keywords parameters. These values are measure in font-size - units. E.g., a fontsize of 10 points and a handlelength=5 + units. e.g., a fontsize of 10 points and a handlelength=5 implies a handlelength of 50 points. Values from rcParams will be used if None. @@ -5361,7 +5361,7 @@ def pie(self, x, explode=None, labels=None, colors=None, The radius of the pie, if *radius* is *None* it will be set to 1. The pie chart will probably look best if the figure and axes are - square. Eg.:: + square. e.g.:: figure(figsize=(8,8)) ax = axes([0.1, 0.1, 0.8, 0.8]) @@ -5545,9 +5545,9 @@ def errorbar(self, x, y, yerr=None, xerr=None, type as *xerr* and *yerr*. *errorevery*: positive integer - subsamples the errorbars. Eg if everyerror=5, errorbars for every - 5-th datapoint will be plotted. The data plot itself still shows - all data points. + subsamples the errorbars. e.g., if everyerror=5, errorbars for + every 5-th datapoint will be plotted. The data plot itself still + shows all data points. All other keyword arguments are passed on to the plot command for the markers. For example, this code makes big red squares with @@ -5873,7 +5873,7 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5, of *conf_intervals* is not None, the notch locations computed by matplotlib are overridden (assuming notch is True). When an element of *conf_intervals* is None, boxplot compute notches the - method specified by the other kwargs (e.g. *bootstrap*). + method specified by the other kwargs (e.g., *bootstrap*). *positions* : [ default 1,2,...,n ] Sets the horizontal positions of the boxes. The ticks and limits @@ -6899,7 +6899,7 @@ def fill(self, *args, **kwargs): The same color strings that :func:~matplotlib.pyplot.plot supports are supported by the fill format string. - If you would like to fill below a curve, eg. shade a region + If you would like to fill below a curve, e.g., shade a region between 0 and *y* along *x*, use :meth:fill_between The *closed* kwarg will close the polygon when *True* (default). @@ -8098,7 +8098,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, counts in that bin plus all bins for smaller values. The last bin gives the total number of datapoints. If normed is also True then the histogram is normalized such that the last bin equals 1. - If cumulative evaluates to less than 0 (e.g. -1), the direction + If cumulative evaluates to less than 0 (e.g., -1), the direction of accumulation is reversed. In this case, if normed is also True, then the histogram is normalized such that the first bin equals 1. @@ -8953,7 +8953,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None, :func:~matplotlib.pyplot.imshow For image options. - For controlling colors, e.g. cyan background and red marks, + For controlling colors, e.g., cyan background and red marks, use:: cmap = mcolors.ListedColormap(['c','r']) @@ -9231,7 +9231,7 @@ def get_geometry(self): # COVERAGE NOTE: Never used internally or from examples def change_geometry(self, numrows, numcols, num): - """change subplot geometry, eg. from 1,1,1 to 2,2,3""" + """change subplot geometry, e.g., from 1,1,1 to 2,2,3""" self._subplotspec = GridSpec(numrows, numcols)[num - 1] self.update_params() self.set_position(self.figbox)
2  lib/matplotlib/backend_bases.py
 @@ -1446,7 +1446,7 @@ class KeyEvent(LocationEvent): the key(s) pressed. Could be **None**, a single case sensitive ascii character ("g", "G", "#", etc.), a special key ("control", "shift", "f1", "up", etc.) or a - combination of the above (e.g. "ctrl+alt+g", "ctrl+alt+G"). + combination of the above (e.g., "ctrl+alt+g", "ctrl+alt+G"). .. note::
8 lib/matplotlib/backends/backend_pdf.py
 @@ -81,7 +81,7 @@ # stack. Thus the state must be pushed onto the stack before narrowing # the clip path. This is taken care of by GraphicsContextPdf. # -# 2. Sometimes it is necessary to refer to something (e.g. font, +# 2. Sometimes it is necessary to refer to something (e.g., font, # image, or extended graphics state, which contains the alpha value) # in the page stream by a name that needs to be defined outside the # stream. PdfFile provides the methods fontName, imageObject, and @@ -93,7 +93,7 @@ # * the alpha channel of images # * image compression could be improved (PDF supports png-like compression) # * encoding of fonts, including mathtext fonts and unicode support -# * TTF support has lots of small TODOs, e.g. how do you know if a font +# * TTF support has lots of small TODOs, e.g., how do you know if a font # is serif/sans-serif, or symbolic/non-symbolic? # * draw_markers, draw_line_collection, etc. @@ -1772,7 +1772,7 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None): assert False self.file.output(Op.end_text) - # Then output the boxes (e.g. variable-length lines of square + # Then output the boxes (e.g., variable-length lines of square # roots). boxgc = self.new_gc() boxgc.copy_properties(gc) @@ -2024,7 +2024,7 @@ def strokep(self): the path, in which case it would presumably be filled. """ # _linewidth > 0: in pdf a line of width 0 is drawn at minimum - # possible device width, but e.g. agg doesn't draw at all + # possible device width, but e.g., agg doesn't draw at all return (self._linewidth > 0 and self._alpha > 0 and (len(self._rgb) <= 3 or self._rgb[3] != 0.0))
2  lib/matplotlib/backends/backend_tkagg.py
 @@ -307,7 +307,7 @@ def _update_pointer_position(self, guiEvent=None): # JDH: this method was written originally to get the pointer # location to the backend lastx and lasty attrs so that events - # like KeyEvent can be handled without mouse events. Eg, if + # like KeyEvent can be handled without mouse events. e.g., if # the cursor is already above the axes, then key presses like # 'g' should toggle the grid. In order for this to work in # backend_bases, the canvas needs to know _lastx and _lasty.
2  lib/matplotlib/backends/backend_wx.py
 @@ -2069,7 +2069,7 @@ def zoomy(self, in_out): def update(self): """ - Update the toolbar menu - called when (e.g.) a new subplot + Update the toolbar menu - e.g., called when a new subplot or axes are added """ DEBUG_MSG("update()", 1, self)
2  lib/matplotlib/backends/qt4_editor/formlayout.py
 @@ -508,7 +508,7 @@ def fedit(data, title="", comment="", icon=None, parent=None, apply=None): """ # Create a QApplication instance if no instance currently exists - # (e.g. if the module is used directly from the interpreter) + # (e.g., if the module is used directly from the interpreter) if QApplication.startingUp(): _app = QApplication([]) dialog = FormDialog(data, title, comment, icon, parent, apply)
6 lib/matplotlib/collections.py
 @@ -1,11 +1,11 @@ """ Classes for the efficient drawing of large collections of objects that -share most properties, e.g. a large number of line segments or +share most properties, e.g., a large number of line segments or polygons. The classes are not meant to be as flexible as their single element -counterparts (e.g. you may not be able to select all line styles) but -they are meant to be fast for common use cases (e.g. a large set of solid +counterparts (e.g., you may not be able to select all line styles) but +they are meant to be fast for common use cases (e.g., a large set of solid line segemnts) """ from __future__ import print_function
2  lib/matplotlib/colorbar.py
 @@ -96,7 +96,7 @@ *format* [ None | format string | Formatter object ] If None, the :class:~matplotlib.ticker.ScalarFormatter is used. - If a format string is given, e.g. '%.3f', that is + If a format string is given, e.g., '%.3f', that is used. An alternative :class:~matplotlib.ticker.Formatter object may be given instead.
2  lib/matplotlib/contour.py
 @@ -78,7 +78,7 @@ def clabel(self, *args, **kwargs): - if *None*, the color of each label matches the color of the corresponding contour - - if one string color, e.g. *colors* = 'r' or *colors* = + - if one string color, e.g., *colors* = 'r' or *colors* = 'red', all labels will be plotted in this color - if a tuple of matplotlib color args (string, float, rgb, etc),
 @@ -856,7 +856,7 @@ def find_tex_file(filename, format=None): 'debug') return result.decode('ascii') -# With multiple text objects per figure (e.g. tick labels) we may end +# With multiple text objects per figure (e.g., tick labels) we may end # up reading the same tfm and vf files many times, so we implement a # simple cache. TODO: is this worth making persistent?
6 lib/matplotlib/figure.py
 @@ -523,7 +523,7 @@ def hold(self, b=None): Set the hold state. If hold is None (default), toggle the hold state. Else set the hold state to boolean value b. - Eg:: + e.g.:: hold() # toggle hold hold(True) # hold is on @@ -775,10 +775,10 @@ def add_axes(self, *args, **kwargs): If the figure already has an axes with the same parameters, then it will simply make that axes current and return it. If - you do not want this behavior, e.g. you want to force the + you do not want this behavior, e.g., you want to force the creation of a new Axes, you must use a unique set of args and kwargs. The axes :attr:~matplotlib.axes.Axes.label - attribute has been exposed for this purpose. Eg., if you want + attribute has been exposed for this purpose. e.g., if you want two axes that are otherwise identical to be added to the figure, make sure you give them unique labels::
10 lib/matplotlib/font_manager.py
 @@ -455,7 +455,7 @@ def ttfFontProperty(font): # Absolute sizes are: xx-small, x-small, small, medium, large, x-large, # and xx-large. # Relative sizes are: larger, smaller - # Length value is an absolute font size, e.g. 12pt + # Length value is an absolute font size, e.g., 12pt # Percentage values are in 'em's. Most robust specification. # !!!! Incomplete @@ -524,7 +524,7 @@ def afmFontProperty(fontpath, font): # Absolute sizes are: xx-small, x-small, small, medium, large, x-large, # and xx-large. # Relative sizes are: larger, smaller - # Length value is an absolute font size, e.g. 12pt + # Length value is an absolute font size, e.g., 12pt # Percentage values are in 'em's. Most robust specification. # All AFM fonts are apparently scalable. @@ -619,7 +619,7 @@ class FontProperties(object): - size: Either an relative value of 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large' or an - absolute font size, e.g. 12 + absolute font size, e.g., 12 The default font property for TrueType fonts (as specified in the default :file:matplotlibrc file) is:: @@ -630,7 +630,7 @@ class FontProperties(object): .ttf file, by using the *fname* kwarg. The preferred usage of font sizes is to use the relative values, - e.g. 'large', instead of absolute font sizes, e.g. 12. This + e.g., 'large', instead of absolute font sizes, e.g., 12. This approach allows all text sizes to be made larger or smaller based on the font manager's default font size. @@ -871,7 +871,7 @@ def set_size(self, size): """ Set the font size. Either an relative value of 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large' - or an absolute font size, e.g. 12. + or an absolute font size, e.g., 12. """ if size is not None: try:
2  lib/matplotlib/legend.py
 @@ -213,7 +213,7 @@ def __init__(self, parent, handles, labels, ================ ==================================================== - The pad and spacing parameters are measured in font-size units. E.g., + The pad and spacing parameters are measured in font-size units. e.g., a fontsize of 10 points and a handlelength=5 implies a handlelength of 50 points. Values from rcParams will be used if None.
4 lib/matplotlib/lines.py
 @@ -339,7 +339,7 @@ def set_fillstyle(self, fs): def set_markevery(self, every): """ Set the markevery property to subsample the plot when using - markers. Eg if markevery=5, every 5-th marker will be + markers. e.g., if markevery=5, every 5-th marker will be plotted. *every* can be None @@ -789,7 +789,7 @@ def set_linestyle(self, linestyle): ACCEPTS: ['-' | '--' | '-.' | ':' | 'None' | ' ' | ''] - and any drawstyle in combination with a linestyle, e.g. 'steps--'. + and any drawstyle in combination with a linestyle, e.g., 'steps--'. """ for ds in self.drawStyleKeys: # long names are first in the list
8 lib/matplotlib/mathtext.py
 @@ -422,7 +422,7 @@ def get_kern(self, font1, fontclass1, sym1, fontsize1, *fontclassX*: TODO - *symX*: a symbol in raw TeX form. e.g. '1', 'x' or '\sigma' + *symX*: a symbol in raw TeX form. e.g., '1', 'x' or '\sigma' *fontsizeX*: the fontsize in points @@ -438,7 +438,7 @@ def get_metrics(self, font, font_class, sym, fontsize, dpi): *font_class*: TODO - *sym*: a symbol in raw TeX form. e.g. '1', 'x' or '\sigma' + *sym*: a symbol in raw TeX form. e.g., '1', 'x' or '\sigma' *fontsize*: font size in points @@ -1175,7 +1175,7 @@ def get_underline_thickness(self, font, fontsize, dpi): # Typesetting math formulas # # Many of the docstrings below refer to a numbered "node" in that -# book, e.g. node123 +# book, e.g., node123 # # Note that (as TeX) y increases downward, unlike many other parts of # matplotlib. @@ -3136,7 +3136,7 @@ def math_to_image(s, filename_or_obj, prop=None, dpi=None, format=None): with the output format. *format* - The output format, eg. 'svg', 'pdf', 'ps' or 'png'. If not + The output format, e.g., 'svg', 'pdf', 'ps' or 'png'. If not provided, will be deduced from the filename. """ from matplotlib import figure
10 lib/matplotlib/mlab.py
 @@ -579,7 +579,7 @@ def cohere_pairs( X, ij, NFFT=256, Fs=2, detrend=detrend_none, - *freqs*: vector of frequencies, equal in length to either the coherence or phase vectors for any (*i*, *j*) key. - Eg., to make a coherence Bode plot:: + e.g., to make a coherence Bode plot:: subplot(211) plot( freqs, Cxy[(12,19)]) @@ -958,7 +958,7 @@ def _interpolate(a, b, fraction): def prctile_rank(x, p): """ Return the rank for each element in *x*, return the rank - 0..len(*p*). Eg if *p* = (25, 50, 75), the return value will be a + 0..len(*p*). e.g., if *p* = (25, 50, 75), the return value will be a len(*x*) array with values in [0,1,2,3] where 0 indicates the value is less than the 25th percentile, 1 indicates the value is >= the 25th and < 50th percentile, ... and 3 indicates the value @@ -1337,7 +1337,7 @@ def save(fname, X, fmt='%.18e',delimiter=' '): save('test2.out', x) # x is 1D save('test3.out', x, fmt='%1.4e') # use exponential notation - *delimiter* is used to separate the fields, eg. *delimiter* ',' + *delimiter* is used to separate the fields, e.g., *delimiter* ',' for comma-separated values. """ @@ -1404,7 +1404,7 @@ def load(fname,comments='#',delimiter=None, converters=None,skiprows=0, - *converters*, if not *None*, is a dictionary mapping column number to a function that will convert that column to a float (or the optional - *dtype* if specified). Eg, if column 0 is a date string:: + *dtype* if specified). e.g., if column 0 is a date string:: converters = {0:datestr2num} @@ -2124,7 +2124,7 @@ def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',', - *missingd* is a dictionary mapping munged column names to field values which signify that the field does not contain actual data and should - be masked, e.g. '0000-00-00' or 'unused' + be masked, e.g., '0000-00-00' or 'unused' - *missing*: a string whose value signals a missing field regardless of the column it appears in
2  lib/matplotlib/mpl-data/fonts/ttf/RELEASENOTES.TXT
 @@ -127,7 +127,7 @@ can be used to force rebuilding fontconfig's cache files. If you note problems, please send them to fonts at gnome dot org, with exactly which face and size and unicode point you observe the problem -at. The xfd utility from XFree86 CVS may be useful for this (e.g. "xfd +at. The xfd utility from XFree86 CVS may be useful for this (e.g., "xfd -fa sans"). A possibly more useful program to examine fonts at a variety of sizes is the "waterfall" program found in Keith Packard's CVS.
2  lib/matplotlib/patches.py
 @@ -1955,7 +1955,7 @@ def transmute(self, x0, y0, width, height, mutation_size): x0, y0 = x0 - pad, y0 - pad, x1, y1 = x0 + width, y0 + height - # Round corners are implemented as quadratic bezier. eg. + # Round corners are implemented as quadratic bezier. e.g., # [(x0, y0-dr), (x0, y0), (x0+dr, y0)] for lower left corner. cp = [(x0 + dr, y0), (x1 - dr, y0),
2  lib/matplotlib/projections/polar.py
 @@ -474,7 +474,7 @@ def set_thetagrids(self, angles, labels=None, frac=None, fmt=None, If *labels* is None, the labels will be fmt %% angle *frac* is the fraction of the polar axes radius at which to - place the label (1 is the edge). Eg. 1.05 is outside the axes + place the label (1 is the edge). e.g., 1.05 is outside the axes and 0.95 is inside the axes. Return value is a list of tuples (*line*, *label*), where
10 lib/matplotlib/pyplot.py
 @@ -107,7 +107,7 @@ def findobj(o=None, match=None): def switch_backend(newbackend): """ Switch the default backend. This feature is **experimental**, and - is only expected to work switching to an image backend. Eg, if + is only expected to work switching to an image backend. e.g., if you have a bunch of PostScript scripts that you want to run from an interactive ipython session, you may want to switch to the PS backend before running them to avoid having a bunch of GUI windows @@ -1351,7 +1351,7 @@ def xlim(*args, **kwargs): xlim( xmin, xmax ) # set the xlim to xmin, xmax If you do not specify args, you can pass the xmin and xmax as - kwargs, eg.:: + kwargs, e.g.:: xlim(xmax=3) # adjust the max leaving min unchanged xlim(xmin=1) # adjust the min leaving max unchanged @@ -1380,7 +1380,7 @@ def ylim(*args, **kwargs): ylim( ymin, ymax ) # set the ylim to ymin, ymax If you do not specify args, you can pass the *ymin* and *ymax* as - kwargs, eg.:: + kwargs, e.g.:: ylim(ymax=3) # adjust the max leaving min unchanged ylim(ymin=1) # adjust the min leaving max unchanged @@ -1605,7 +1605,7 @@ def thetagrids(*args, **kwargs): If *labels* is *None*, the labels will be fmt%angle. *frac* is the fraction of the polar axes radius at which to place - the label (1 is the edge). Eg. 1.05 is outside the axes and 0.95 + the label (1 is the edge). e.g., 1.05 is outside the axes and 0.95 is inside the axes. Return value is a list of tuples (*lines*, *labels*): @@ -2169,7 +2169,7 @@ def plotfile(fname, cols=(0,), plotfuncs=None, an :class:~matplotlib.axes.Axes plotting function as a string. Default is 'plot', other choices are 'semilogy', 'fill', 'bar', etc. You must use the same type of identifier in the *cols* - vector as you use in the *plotfuncs* dictionary, eg., integer + vector as you use in the *plotfuncs* dictionary, e.g., integer column numbers in both or column names in both. If *subplots* is *False*, then including any function such as 'semilogy' that changes the axis scaling will set the scaling for all
2  lib/matplotlib/quiver.py
 @@ -91,7 +91,7 @@ of values in degrees, CCW from the *x*-axis. *scale*: [ *None* | float ] - Data units per arrow length unit, e.g. m/s per plot width; a smaller + Data units per arrow length unit, e.g., m/s per plot width; a smaller scale parameter makes the arrow longer. If *None*, a simple autoscaling algorithm is used, based on the average vector length and the number of vectors. The arrow length unit is given by
2  lib/matplotlib/streamplot.py
 @@ -202,7 +202,7 @@ class DomainMap(object): This class also has methods for adding trajectories to the StreamMask. Before adding a trajectory, run start_trajectory to keep track of regions crossed by a given trajectory. Later, if you decide the trajectory is bad - (e.g. if the trajectory is very short) just call undo_trajectory. + (e.g., if the trajectory is very short) just call undo_trajectory. """ def __init__(self, grid, mask):
2  lib/matplotlib/tests/test_colors.py
 @@ -40,7 +40,7 @@ def test_BoundaryNorm(): def test_LogNorm(): """ LogNorm igornoed clip, now it has the same - behavior as Normalize, e.g. values > vmax are bigger than 1 + behavior as Normalize, e.g., values > vmax are bigger than 1 without clip, with clip they are 1. """ ln = mcolors.LogNorm(clip=True, vmax=5)
2  lib/matplotlib/text.py
 @@ -1795,7 +1795,7 @@ def __init__(self, s, xy, If a 'points' or 'pixels' option is specified, values will be added to the bottom-left and if negative, values will be - subtracted from the top-right. Eg:: + subtracted from the top-right. e.g.:: # 10 points to the right of the left border of the axes and # 5 points below the top border
6 lib/matplotlib/ticker.py
 @@ -27,7 +27,7 @@ Tick locations are fixed :class:IndexLocator - locator for index plots (eg. where x = range(len(y))) + locator for index plots (e.g., where x = range(len(y))) :class:LinearLocator evenly spaced ticks from min to max @@ -416,7 +416,7 @@ def set_powerlimits(self, lims): ''' Sets size thresholds for scientific notation. - e.g. formatter.set_powerlimits((-3, 4)) sets the pre-2007 default + e.g., formatter.set_powerlimits((-3, 4)) sets the pre-2007 default in which scientific notation is used for numbers less than 1e-3 or greater than 1e4. See also :meth:set_scientific. @@ -772,7 +772,7 @@ def __call__(self, x, pos=None): class EngFormatter(Formatter): """ Formats axis values using engineering prefixes to represent powers of 1000, - plus a specified unit, eg. 10 MHz instead of 1e7. + plus a specified unit, e.g., 10 MHz instead of 1e7. """ # The SI engineering prefixes
2  lib/matplotlib/tight_layout.py
 @@ -300,7 +300,7 @@ def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer, ax_bbox_list = [] subplot_dict = {} # multiple axes can share - # same subplot_interface (e.g, axes_grid1). Thus + # same subplot_interface (e.g., axes_grid1). Thus # we need to join them together. subplotspec_list2 = []
4 lib/matplotlib/tri/triinterpolate.py
 @@ -119,7 +119,7 @@ def _interpolate_multikeys(self, x, y, tri_index=None, - calculation of containing triangles - dealing with more than one interpolation request at the same - location (e.g. if the 2 derivatives are requested, it is + location (e.g., if the 2 derivatives are requested, it is unnecessary to compute the containing triangles twice) - scaling according to self._unit_x, self._unit_y - dealing with points outside of the grid (with fill value np.nan) @@ -129,7 +129,7 @@ def _interpolate_multikeys(self, x, y, tri_index=None, (Note that np.vectorize could do most of those things very well for you, but it does it by function evaluations over successive tuples of the input arrays. Therefore, this tends to be more time consuming than - using optimized numpy functions - e.g. np.dot - which can be used + using optimized numpy functions - e.g., np.dot - which can be used easily on the flattened inputs, in the child-subclass methods :meth:_interpolate_single_key.)
2  lib/matplotlib/tri/triplot.py
 @@ -49,7 +49,7 @@ def triplot(ax, *args, **kwargs): # then the markers are drawn more than once which is incorrect if alpha<1. # Hence draw lines and markers separately. - # Decode plot format string, e.g. 'ro-' + # Decode plot format string, e.g., 'ro-' fmt = '' if len(args) > 0: fmt = args[0]
4 lib/matplotlib/tri/trirefine.py
 @@ -108,7 +108,7 @@ def refine_triangulation(self, return_tri_index=False, subdiv=3): # Now we compute found_index table if needed if return_tri_index: # We have to initialize found_index with -1 because some nodes - # may very well belong to no triangle at all, e.g. in case of + # may very well belong to no triangle at all, e.g., in case of # Delaunay Triangulation with DuplicatePointWarning. found_index = - np.ones(refi_npts, dtype=np.int32) tri_mask = self._triangulation.mask @@ -160,7 +160,7 @@ def refine_field(self, z, triinterpolator=None, subdiv=3): Examples -------- The main application of this method is to plot high-quality - iso-contours on a coarse triangular grid (e.g. triangulation built + iso-contours on a coarse triangular grid (e.g., triangulation built from relatively sparse test data): .. plot:: mpl_examples/pylab_examples/tricontour_smooth_user.py
4 lib/matplotlib/type1font.py
 @@ -264,7 +264,7 @@ def fontmatrix(array): def replace(fun): def replacer(tokens): - token, value = next(tokens) # name, e.g. /FontMatrix + token, value = next(tokens) # name, e.g., /FontMatrix yield value token, value = next(tokens) # possible whitespace while token == 'whitespace': @@ -272,7 +272,7 @@ def replacer(tokens): token, value = next(tokens) if value != '[': # name/number/etc. yield fun(value) - else: # array, e.g. [1 2 3] + else: # array, e.g., [1 2 3] array = [] while value != ']': array += value
2  lib/mpl_toolkits/axes_grid/colorbar.py
 @@ -67,7 +67,7 @@ *format* [ None | format string | Formatter object ] If None, the :class:~matplotlib.ticker.ScalarFormatter is used. - If a format string is given, e.g. '%.3f', that is + If a format string is given, e.g., '%.3f', that is used. An alternative :class:~matplotlib.ticker.Formatter` object may be given instead.
2  lib/mpl_toolkits/axes_grid1/axes_divider.py
 @@ -470,7 +470,7 @@ def get_geometry(self): # COVERAGE NOTE: Never used internally or from examples def change_geometry(self, numrows, numcols, num): - 'change subplot geometry, eg. from 1,1,1 to 2,2,3' + 'change subplot geometry, e.g., from 1,1,1 to 2,2,3' self._subplotspec = GridSpec(numrows, numcols)[num-1] self.update_params() self.set_position(self.figbox)