-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MEP12 API examples #7439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MEP12 API examples #7439
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
'''Demonstration of LineCollection, PolyCollection, and | ||
RegularPolyCollection with autoscaling. | ||
''' | ||
========================================================= | ||
Line and Poly and RegularPoly Collection with autoscaling | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line, Poly, and ... |
||
========================================================= | ||
|
||
For the first two subplots, we will use spirals. Their | ||
size will be set in plot units, not data units. Their positions | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
""" | ||
======== | ||
Colorbar | ||
======== | ||
|
||
This example shows how to use colorbar by specify the mappable object (here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. specify -> specifying |
||
the imshow returned object) and the axes to attach the colorbar to. | ||
""" | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
""" | ||
Make a compund path -- in this case two simple polygons, a rectangle | ||
============= | ||
Compound path | ||
============= | ||
|
||
Make a compound path -- in this case two simple polygons, a rectangle | ||
and a triangle. Use CLOSEOPOLY and MOVETO for the different parts of | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's an existing typo here; should be |
||
the compound path | ||
""" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
""" | ||
================= | ||
Custom projection | ||
================= | ||
|
||
This example showcases the Hammer projection by alleviating many features of | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think alleviating is the right verb here; not sure what it's trying to say (utilizing/using would fit without changing the sentence, but doesn't quite imply the same things.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed this one. |
||
matplotlib. | ||
""" | ||
|
||
|
||
from __future__ import unicode_literals | ||
|
||
import matplotlib | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
""" | ||
==================================== | ||
Custom tick formatter for timeseries | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. timeseries -> time series |
||
==================================== | ||
|
||
When plotting time series, e.g., financial time series, one often wants | ||
to leave out days on which there is no data, eh weekends. The example | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing "eh" here is probably not someone being Canadian... Probably should be "e.g.," or maybe "i.e.,". |
||
below shows how to use an 'index formatter' to achieve the desired plot | ||
|
@@ -19,8 +23,10 @@ | |
|
||
|
||
# first we'll do it the default way, with gaps on weekends | ||
fig, ax = plt.subplots() | ||
fig, axes = plt.subplots(ncols=2, figsize=(8, 4)) | ||
ax = axes[0] | ||
ax.plot(r.date, r.adj_close, 'o-') | ||
ax.set_title("Default") | ||
fig.autofmt_xdate() | ||
|
||
# next we'll write a custom formatter | ||
|
@@ -32,9 +38,10 @@ def format_date(x, pos=None): | |
thisind = np.clip(int(x + 0.5), 0, N - 1) | ||
return r.date[thisind].strftime('%Y-%m-%d') | ||
|
||
fig, ax = plt.subplots() | ||
ax = axes[1] | ||
ax.plot(ind, r.adj_close, 'o-') | ||
ax.xaxis.set_major_formatter(ticker.FuncFormatter(format_date)) | ||
ax.set_title("Custom tick formatter") | ||
fig.autofmt_xdate() | ||
|
||
plt.show() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
''' | ||
========================================= | ||
Labeling ticks using engineering notations | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. notations -> notation |
||
========================================= | ||
|
||
Demo to show use of the engineering Formatter. | ||
''' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
""" | ||
========================= | ||
Hatched filled histograms | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hatched filled -> Hatch-filled |
||
========================= | ||
|
||
This example showcases the hatching capabilities of matplotlib by plotting | ||
various histograms. | ||
""" | ||
|
||
import itertools | ||
from collections import OrderedDict | ||
from functools import partial | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
""" | ||
=========== | ||
Join styles | ||
=========== | ||
|
||
Illustrate the three different join styles | ||
""" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
""" | ||
Load a mathtext image as numpy array | ||
=============================== | ||
A mathtext image as numpy array | ||
=============================== | ||
|
||
This example shows how to make images from latex strings. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. latex -> LaTeX |
||
""" | ||
|
||
import matplotlib.mathtext as mathtext | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
""" | ||
============ | ||
Bezier Curve | ||
============ | ||
|
||
This example showcases the PathPatch object to create a bezier polycurve path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bezier -> Bezier (or even better to include the accent Bézier) |
||
patch. | ||
""" | ||
|
||
import matplotlib.path as mpath | ||
import matplotlib.patches as mpatches | ||
import matplotlib.pyplot as plt | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
""" | ||
Example of creating a radar chart (a.k.a. a spider or star chart) [1]_. | ||
===================================== | ||
Radar chart (aka spider or star chart | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Closing parenthesis missing. |
||
===================================== | ||
|
||
This example creates a radar chart, also known as a spider or star chart [1]_. | ||
|
||
Although this example allows a frame of either 'circle' or 'polygon', polygon | ||
frames don't have proper gridlines (the lines are circles instead of polygons). | ||
|
@@ -187,7 +191,8 @@ def example_data(): | |
# add legend relative to top-left plot | ||
ax = axes[0, 0] | ||
labels = ('Factor 1', 'Factor 2', 'Factor 3', 'Factor 4', 'Factor 5') | ||
legend = ax.legend(labels, loc=(0.9, .95), labelspacing=0.1, fontsize='small') | ||
legend = ax.legend(labels, loc=(0.9, .95), | ||
labelspacing=0.1, fontsize='small') | ||
|
||
fig.text(0.5, 0.965, '5-Factor Solution Profiles Across Four Scenarios', | ||
horizontalalignment='center', color='black', weight='bold', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
"""Demonstrate the Sankey class by producing three basic diagrams. | ||
""" | ||
================ | ||
The Sankey class | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 50/50 on changing class to diagram here too. |
||
================ | ||
|
||
Demonstrate the Sankey class by producing three basic diagrams. | ||
""" | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interescting -> intersecting
other one -> others