-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tidied up some of the documentation.
- Loading branch information
Showing
19 changed files
with
235 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
cm (colormap) | ||
************* | ||
|
||
|
||
:mod:`matplotlib.cm` | ||
==================== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
************* | ||
configuration | ||
************* | ||
|
||
|
||
:mod:`matplotlib` | ||
================= | ||
The top level :mod:`matplotlib` module | ||
====================================== | ||
|
||
.. automodule:: matplotlib | ||
:members: rc, rcdefaults, use | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,57 @@ | ||
#!/usr/bin/env python | ||
""" | ||
See pcolor_demo2 for an alternative way of generating pcolor plots | ||
using imshow that is likely faster for large grids | ||
Demonstrates similarities between pcolor, pcolormesh, imshow and pcolorfast | ||
for drawing quadrilateral grids. | ||
""" | ||
from __future__ import division | ||
from matplotlib.patches import Patch | ||
from pylab import * | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
def func3(x,y): | ||
return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2) | ||
# make these smaller to increase the resolution | ||
dx, dy = 0.15, 0.05 | ||
|
||
# generate 2 2d grids for the x & y bounds | ||
y, x = np.mgrid[slice(-3, 3 + dy, dy), | ||
slice(-3, 3 + dx, dx)] | ||
z = (1 - x / 2. + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2) | ||
# x and y are bounds, so z should be the value *inside* those bounds. | ||
# Therefore, remove the last value from the z array. | ||
z = z[:-1, :-1] | ||
z_min, z_max = -np.abs(z).max(), np.abs(z).max() | ||
|
||
|
||
|
||
plt.subplot(2, 2, 1) | ||
plt.pcolor(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max) | ||
plt.title('pcolor') | ||
# set the limits of the plot to the limits of the data | ||
plt.axis([x.min(), x.max(), y.min(), y.max()]) | ||
plt.colorbar() | ||
|
||
|
||
|
||
plt.subplot(2, 2, 2) | ||
plt.pcolormesh(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max) | ||
plt.title('pcolormesh') | ||
# set the limits of the plot to the limits of the data | ||
plt.axis([x.min(), x.max(), y.min(), y.max()]) | ||
plt.colorbar() | ||
|
||
|
||
|
||
plt.subplot(2, 2, 3) | ||
plt.imshow(z, cmap='RdBu', vmin=z_min, vmax=z_max, | ||
extent=[x.min(), x.max(), y.min(), y.max()], | ||
interpolation='nearest', origin='lower') | ||
plt.title('image (interp. nearest)') | ||
plt.colorbar() | ||
|
||
# make these smaller to increase the resolution | ||
dx, dy = 0.05, 0.05 | ||
|
||
x = arange(-3.0, 3.0001, dx) | ||
y = arange(-3.0, 3.0001, dy) | ||
X,Y = meshgrid(x, y) | ||
|
||
Z = func3(X, Y) | ||
pcolor(X, Y, Z, cmap=cm.RdBu, vmax=abs(Z).max(), vmin=-abs(Z).max()) | ||
colorbar() | ||
axis([-3,3,-3,3]) | ||
ax = plt.subplot(2, 2, 4) | ||
ax.pcolorfast(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max) | ||
plt.title('pcolorfast') | ||
plt.colorbar() | ||
|
||
show() | ||
|
||
|
||
plt.show() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.