Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ecad7b9

Browse filesBrowse files
committed
DOC: add data source to csv
1 parent cac2bc6 commit ecad7b9
Copy full SHA for ecad7b9

File tree

Expand file treeCollapse file tree

2 files changed

+9
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-8
lines changed

‎examples/showcase/stock_prices.py

Copy file name to clipboardExpand all lines: examples/showcase/stock_prices.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
66
.. redirect-from:: /gallery/showcase/bachelors_degrees_by_gender
77
8-
A graph of multiple time series that demonstrates custom
9-
styling of plot frame, tick lines, tick labels, and line graph properties.
8+
A graph of multiple time series that demonstrates custom styling of plot frame,
9+
tick lines, tick labels, and line graph properties. It also uses custom
10+
placement of text labels along the right edge as an alternative to a
11+
conventional legend.
1012
11-
Also demonstrates the custom placement of text labels along the right edge
12-
as an alternative to a conventional legend.
13-
14-
Note: The third-party mpl style dufte_ produces similar-looking plots with
15-
less code.
13+
Note: The third-party mpl style dufte_ produces similar-looking plots with less
14+
code.
1615
1716
.. _dufte: https://github.com/nschloe/dufte
1817
"""
@@ -29,7 +28,8 @@ def convertdate(x):
2928

3029
fname = get_sample_data('Stocks.csv', asfileobj=False)
3130
stock_data = np.genfromtxt(fname, encoding='utf-8', delimiter=',',
32-
names=True, dtype=None, converters={0: convertdate})
31+
names=True, dtype=None, converters={0: convertdate},
32+
skip_header=1)
3333

3434

3535
fig, ax = plt.subplots(1, 1, figsize=(6, 8), layout='constrained')

‎lib/matplotlib/mpl-data/sample_data/Stocks.csv

Copy file name to clipboardExpand all lines: lib/matplotlib/mpl-data/sample_data/Stocks.csv
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Data source: https://finance.yahoo.com
12
Date,IBM,AAPL,MSFT,XRX,AMZN,DELL,GOOGL,ADBE,^GSPC,^IXIC
23
1990-01-01,10.970438003540039,0.24251236021518707,0.40375930070877075,11.202081680297852,,,,1.379060983657837,329.0799865722656,415.79998779296875
34
1990-02-01,11.554415702819824,0.24251236021518707,0.43104037642478943,10.39472484588623,,,,1.7790844440460205,331.8900146484375,425.79998779296875

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.