X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/mpl_toolkits/axes_grid/figures/simple_axisartist1.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ax.axis["bottom", "top", "right"].set_visible(False)

# make an new axis along the first axis axis (x-axis) which pass
# throught y=0.
# through y=0.
ax.axis["y=0"] = ax.new_floating_axis(nth_coord=0, value=0,
axis_direction="bottom")
ax.axis["y=0"].toggle(all=True)
Expand Down
2 changes: 1 addition & 1 deletion doc/mpl_toolkits/axes_grid/figures/simple_axisline2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

fig = plt.figure(1, (4,3))

# a subplot with two additiona axis, "xzero" and "yzero". "xzero" is
# a subplot with two additional axis, "xzero" and "yzero". "xzero" is
# y=0 line, and "yzero" is x=0 line.
ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)
Expand Down
2 changes: 1 addition & 1 deletion doc/users/plotting/examples/custom_boxstyle02.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import matplotlib.pyplot as plt

# we may derive from matplotlib.patches.BoxStyle._Base class.
# You need to overide transmute method in this case.
# You need to override transmute method in this case.

class MyStyle(BoxStyle._Base):
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/api/barchart_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# add some text for labels, title and axes ticks
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind + width)
ax.set_xticks(ind + width / 2)
ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5'))

ax.legend((rects1[0], rects2[0]), ('Men', 'Women'))
Expand Down
2 changes: 1 addition & 1 deletion examples/api/date_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
datafile = cbook.get_sample_data('goog.npy')
try:
# Python3 cannot load python2 .npy files with datetime(object) arrays
# unless the encoding is set to bytes. Hovever this option was
# unless the encoding is set to bytes. However this option was
# not added until numpy 1.10 so this example will only work with
# python 2 or with numpy 1.10 and later.
r = np.load(datafile, encoding='bytes').view(np.recarray)
Expand Down
2 changes: 1 addition & 1 deletion examples/api/font_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Although it is usually not a good idea to explicitly point to a single
ttf file for a font instance, you can do so using the
font_manager.FontProperties fname argument (for a more flexible
solution, see the font_fmaily_rc.py and fonts_demo.py examples).
solution, see the font_family_rc.py and fonts_demo.py examples).
"""
import sys
import os
Expand Down
2 changes: 1 addition & 1 deletion examples/api/histogram_path_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
the faster method of using PolyCollections, were implemented before we
had proper paths with moveto/lineto, closepoly etc in mpl. Now that
we have them, we can draw collections of regularly shaped objects with
homogeous properties more efficiently with a PathCollection. This
homogeneous properties more efficiently with a PathCollection. This
example makes a histogram -- its more work to set up the vertex arrays
at the outset, but it should be much faster for large numbers of
objects
Expand Down
2 changes: 1 addition & 1 deletion examples/api/radar_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def example_data():
# Pyrolized Organic Carbon (OP)
# 2)Inclusion of gas-phase specie carbon monoxide (CO)
# 3)Inclusion of gas-phase specie ozone (O3).
# 4)Inclusion of both gas-phase speciesis present...
# 4)Inclusion of both gas-phase species is present...
data = [
['Sulfate', 'Nitrate', 'EC', 'OC1', 'OC2', 'OC3', 'OP', 'CO', 'O3'],
('Basecase', [
Expand Down
8 changes: 4 additions & 4 deletions examples/api/unicode_minus.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Unicode minus
=============

You can use the proper typesetting unicode minus (see
http://en.wikipedia.org/wiki/Plus_sign#Plus_sign) or the ASCII hypen
You can use the proper typesetting Unicode minus (see
https://en.wikipedia.org/wiki/Plus_sign#Plus_sign) or the ASCII hyphen
for minus, which some people prefer. The matplotlibrc param
axes.unicode_minus controls the default behavior.

The default is to use the unicode minus
The default is to use the Unicode minus.
"""
import numpy as np
import matplotlib
Expand All @@ -17,5 +17,5 @@
matplotlib.rcParams['axes.unicode_minus'] = False
fig, ax = plt.subplots()
ax.plot(10*np.random.randn(100), 10*np.random.randn(100), 'o')
ax.set_title('Using hypen instead of unicode minus')
ax.set_title('Using hyphen instead of Unicode minus')
plt.show()
2 changes: 1 addition & 1 deletion examples/axes_grid/demo_curvelinear_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def curvelinear_test2(fig):
# A parasite axes with given transform
ax2 = ParasiteAxesAuxTrans(ax1, tr, "equal")
# note that ax2.transData == tr + ax1.transData
# Anthing you draw in ax2 will match the ticks and grids of ax1.
# Anything you draw in ax2 will match the ticks and grids of ax1.
ax1.parasites.append(ax2)
intp = cbook.simple_linear_interpolation
ax2.plot(intp(np.array([0, 30]), 50),
Expand Down
2 changes: 1 addition & 1 deletion examples/axes_grid/demo_floating_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setup_axes1(fig, rect):
tr = Affine2D().scale(2, 1).rotate_deg(30)

grid_helper = floating_axes.GridHelperCurveLinear(
tr, extremes=(0, 4, 0, 4))
tr, extremes=(-0.5, 3.5, 0, 4))

ax1 = floating_axes.FloatingSubplot(fig, rect, grid_helper=grid_helper)
fig.add_subplot(ax1)
Expand Down
2 changes: 1 addition & 1 deletion examples/axes_grid/demo_parasite_axes2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
to plot multiple different values onto one single plot. Notice how in this
example, par1 and par2 are both calling twinx meaning both are tied directly to
the x-axis. From there, each of those two axis can behave separately from the
each other, meaning they can take on seperate values from themselves as well as
each other, meaning they can take on separate values from themselves as well as
the x-axis.
"""
from mpl_toolkits.axes_grid1 import host_subplot
Expand Down
2 changes: 1 addition & 1 deletion examples/event_handling/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matplotlib supports event handling with a GUI neutral event model. So
you can connect to matplotlib events w/o knowledge of what user
interface matplotlib will ultimately be plugged in to. This has two
advantages: the code you write will be more portable, and matplotlib
events are aware of things like data coordinate space and whih axes
events are aware of things like data coordinate space and which axes
the event occurs in so you don't have to mess with low level
transformation details to go from canvas space to data space. Object
picking examples are also included.
3 changes: 1 addition & 2 deletions examples/event_handling/lasso_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ def __init__(self, ax, data):

facecolors = [d.color for d in data]
self.xys = [(d.x, d.y) for d in data]
fig = ax.figure
self.collection = RegularPolyCollection(
fig.dpi, 6, sizes=(100,),
6, sizes=(100,),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 -> rotation angle; not sure if the fig.dpi was intended to produce perfect circles and the 6 should have been deleted instead.

facecolors=facecolors,
offsets=self.xys,
transOffset=ax.transData)
Expand Down
2 changes: 1 addition & 1 deletion examples/event_handling/legend_picking.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Enable picking on the legend to toggle the legended line on and off
Enable picking on the legend to toggle the original line on and off
"""
import numpy as np
import matplotlib.pyplot as plt
Expand Down
4 changes: 2 additions & 2 deletions examples/event_handling/viewlims.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __call__(self, ax):
# A class that will regenerate a fractal set as we zoom in, so that you
# can actually see the increasing detail. A box in the left panel will show
# the area to which we are zoomed.
class MandlebrotDisplay(object):
class MandelbrotDisplay(object):
def __init__(self, h=500, w=500, niter=50, radius=2., power=2):
self.height = h
self.width = w
Expand Down Expand Up @@ -57,7 +57,7 @@ def ax_update(self, ax):
im.set_extent((xstart, xend, ystart, yend))
ax.figure.canvas.draw_idle()

md = MandlebrotDisplay()
md = MandelbrotDisplay()
Z = md(-2., 0.5, -1.25, 1.25)

fig1, (ax1, ax2) = plt.subplots(1, 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
speed = np.sqrt(U*U + V*V)

mask = np.zeros(U.shape, dtype=bool)
mask[40:60, 40:60] = 1
U = np.ma.array(U, mask=mask)
mask[40:60, 40:60] = True
U[:20, :20] = np.nan
U = np.ma.array(U, mask=mask)

fig, ax = plt.subplots()
ax.streamplot(X, Y, U, V, color='r')
Expand Down
4 changes: 2 additions & 2 deletions examples/misc/ftface_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
This is a demo script to show you how to use all the properties of an
FT2Font object. These describe global font properties. For
individual character metrices, use the Glyp object, as returned by
individual character metrics, use the Glyph object, as returned by
load_char
"""
import matplotlib
Expand All @@ -18,7 +18,7 @@
print('Num faces :', font.num_faces) # number of faces in file
print('Num glyphs :', font.num_glyphs) # number of glyphs in the face
print('Family name :', font.family_name) # face family name
print('Syle name :', font.style_name) # face syle name
print('Style name :', font.style_name) # face style name
print('PS name :', font.postscript_name) # the postscript name
print('Num fixed :', font.num_fixed_sizes) # number of embedded bitmap in face

Expand Down
2 changes: 1 addition & 1 deletion examples/misc/sample_data_demo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Grab mpl data from the ~/.matplotlib/sample_data cache if it exists, else
fetch it from github and cache it
fetch it from GitHub and cache it
"""
from __future__ import print_function
import matplotlib.cbook as cbook
Expand Down
4 changes: 2 additions & 2 deletions examples/misc/svg_filter_line.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Demonstrate SVG filtering effects which might be used with mpl.

Note that the filtering effects are only effective if your svg rederer
Note that the filtering effects are only effective if your svg renderer
support it.
"""

Expand Down Expand Up @@ -78,7 +78,7 @@
for l in [l1, l2]:
# pick up the svg element with given id
shadow = xmlid[l.get_label() + "_shadow"]
# apply shdow filter
# apply shadow filter
shadow.set("filter", 'url(#dropshadow)')

fn = "svg_filter_line.svg"
Expand Down
10 changes: 5 additions & 5 deletions examples/misc/svg_filter_pie.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Demonstrate SVG filtering effects which might be used with mpl.
The pie chart drawing code is borrowed from pie_demo.py

Note that the filtering effects are only effective if your svg rederer
Note that the filtering effects are only effective if your svg renderer
support it.
"""

Expand Down Expand Up @@ -50,12 +50,12 @@


# filter definition for shadow using a gaussian blur
# and lighteneing effect.
# The lightnening filter is copied from http://www.w3.org/TR/SVG/filters.html
# and lightening effect.
# The lightening filter is copied from http://www.w3.org/TR/SVG/filters.html

# I tested it with Inkscape and Firefox3. "Gaussian blur" is supported
# in both, but the lightnening effect only in the inkscape. Also note
# that, inkscape's exporting also may not support it.
# in both, but the lightening effect only in the Inkscape. Also note
# that, Inkscape's exporting also may not support it.

filter_def = """
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
Expand Down
11 changes: 0 additions & 11 deletions examples/pylab_examples/README
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
Here are some demos of how to use the matplotlib.


-- data_helper.py - a convenience module to load some data from the
data dir

-- embedding_in_gtk - The Figure class derives from gtk.DrawingArea,
so it is easy to embed in larger applications.

Expand All @@ -14,11 +11,3 @@ Here are some demos of how to use the matplotlib.
-- subplot_demo.py - how to do multiple axes on a single plot

-- vline_hline_demo.py - working with straight lines

-- stock_demo.py - working with large datasets. Click on the plot and
launch the navigation tool; wheel mouse over the navigation
buttons to scroll and zoom. There are 58 days of minute by
minute stock quotes for two tickers. The plot lib uses
Numeric's super speedy searchsorted routine to extract the
clipping indices so only the data in the viewport are handled.

2 changes: 1 addition & 1 deletion examples/pylab_examples/accented_text.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
matplotlib supports accented characters via TeX mathtext

The following accents are provided: \hat, \breve, \grave, \bar,
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/bar_stacked.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

plt.ylabel('Scores')
plt.title('Scores by group and gender')
plt.xticks(ind + width/2., ('G1', 'G2', 'G3', 'G4', 'G5'))
plt.xticks(ind, ('G1', 'G2', 'G3', 'G4', 'G5'))
plt.yticks(np.arange(0, 81, 10))
plt.legend((p1[0], p2[0]), ('Men', 'Women'))

Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/barchart_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
plt.xlabel('Group')
plt.ylabel('Scores')
plt.title('Scores by group and gender')
plt.xticks(index + bar_width, ('A', 'B', 'C', 'D', 'E'))
plt.xticks(index + bar_width / 2, ('A', 'B', 'C', 'D', 'E'))
plt.legend()

plt.tight_layout()
Expand Down
3 changes: 2 additions & 1 deletion examples/pylab_examples/barchart_demo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def plot_student_results(student, scores, cohort_size):
fig.subplots_adjust(left=0.115, right=0.88)
fig.canvas.set_window_title('Eldorado K-8 Fitness Chart')

pos = np.arange(len(testNames)) + 0.5 # Center bars on the Y-axis ticks
pos = np.arange(len(testNames))

rects = ax1.barh(pos, [scores[k].percentile for k in testNames],
align='center',
Expand Down Expand Up @@ -160,3 +160,4 @@ def plot_student_results(student, scores, cohort_size):
cohort_size = 62 # The number of other 2nd grade boys

arts = plot_student_results(student, scores, cohort_size)
plt.show()
2 changes: 1 addition & 1 deletion examples/pylab_examples/centered_ticklabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
fh = cbook.get_sample_data('aapl.npy.gz')
try:
# Python3 cannot load python2 .npy files with datetime(object) arrays
# unless the encoding is set to bytes. Hovever this option was
# unless the encoding is set to bytes. However this option was
# not added until numpy 1.10 so this example will only work with
# python 2 or with numpy 1.10 and later.
r = np.load(fh, encoding='bytes')
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/custom_ticker1.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ def millions(x, pos):
fig, ax = plt.subplots()
ax.yaxis.set_major_formatter(formatter)
plt.bar(x, money)
plt.xticks(x + 0.5, ('Bill', 'Fred', 'Mary', 'Sue'))
plt.xticks(x, ('Bill', 'Fred', 'Mary', 'Sue'))
plt.show()
60 changes: 0 additions & 60 deletions examples/pylab_examples/data_helper.py

This file was deleted.

Loading
X Tutup