-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86b0b73
commit 1b197fb
Showing
7 changed files
with
47 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fig, ax = plt.subplots(1, 1) | ||
ax.set_ylim(1000, 500) | ||
plt.show() |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
fig, ax = plt.subplots(1, 1) | ||
ax.plot([-2, 2, 3, 4], [-10, 20, 25, 5]) | ||
|
||
ax.spines['top'].set_position('center') | ||
ax.spines['right'].set_position('center') | ||
ax.tick_params(axis='both', direction='inout', length=10) | ||
|
||
# Move the two remaining spines "out" away from the plot by 10 points | ||
ax.spines['bottom'].set_position(('outward', 10)) | ||
ax.spines['left'].set_position(('outward', 10)) | ||
|
||
plt.show() |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
t = np.arange(0.0, 5.0, 0.2) | ||
plt.plot(t, t, 'r', t, t**2, 'cyan', t, t**3, '0.7') | ||
plt.show() |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
t = np.arange(0.0, 5.0, 0.2) | ||
plt.plot(t, t, "*y", t, t**2, "8m", t, t**3, "sg") | ||
plt.show() |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
t = np.arange(0.0, 5.0, 0.1) | ||
a = np.exp(-t) * np.cos(2*np.pi*t) | ||
plt.plot(t, a, 'r:', marker='D', mfc='y') | ||
plt.show() |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
t = np.arange(0.0, 5.0, 0.01) | ||
s = np.cos(2*np.pi*t) | ||
plt.plot(t, s, lw=2) | ||
|
||
plt.annotate('local min', xy=(2.5, -1), xytext=(3.5, -1.5), | ||
arrowprops=dict(arrowstyle='fancy', color='red', shrink=0.5)) | ||
|
||
plt.ylim(-2, 2) | ||
plt.show() |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import matplotlib.pyplot as plt | ||
from matplotlib.collections import StarPolygonCollection | ||
|
||
fig, ax = plt.subplots(1, 1) | ||
|
||
offsets = zip([0.2, 0.4, 0.6, 0.8], [0.5] * 4) | ||
collection = StarPolygonCollection(5, | ||
offsets=offsets, | ||
transOffset=ax.transData, | ||
facecolors=['gold'], | ||
sizes=[75]) | ||
ax.add_collection(collection) | ||
plt.show() |