Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import matplotlib.cbook as cbook

# load up some sample financial data
r = cbook.get_sample_data('goog.npz')['price_data'].view(np.recarray)
r = cbook.get_sample_data('goog.npz')['price_data'].view(np.rec.recarray)
# create two subplots with the shared x and y axes
fig, (ax1, ax2) = plt.subplots(1, 2, sharex=True, sharey=True)

Expand Down
4 changes: 3 additions & 1 deletion galleries/examples/lines_bars_and_markers/scatter_demo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# low, close, volume, adj_close from the mpl-data/sample_data directory. The
# record array stores the date as an np.datetime64 with a day unit ('D') in
# the date column.
price_data = cbook.get_sample_data('goog.npz')['price_data'].view(np.recarray)
price_data = cbook.get_sample_data('goog.npz')['price_data'].view(
np.rec.recarray
)
price_data = price_data[-250:] # get the most recent 250 trading days

delta1 = np.diff(price_data.adj_close) / price_data.adj_close[:-1]
Expand Down
2 changes: 1 addition & 1 deletion galleries/examples/misc/keyword_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

There are some instances where you have data in a format that lets you
access particular variables with strings: for example, with
`numpy.recarray` or `pandas.DataFrame`.
`numpy.rec.recarray` or `pandas.DataFrame`.

Matplotlib allows you to provide such an object with the ``data`` keyword
argument. If provided, you may generate plots with the strings
Expand Down
2 changes: 1 addition & 1 deletion galleries/examples/ticks/centered_ticklabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import matplotlib.ticker as ticker

# Load some financial data; Google's stock price
r = cbook.get_sample_data('goog.npz')['price_data'].view(np.recarray)
r = cbook.get_sample_data('goog.npz')['price_data'].view(np.rec.recarray)
r = r[-250:] # get the last 250 days

fig, ax = plt.subplots()
Expand Down
2 changes: 1 addition & 1 deletion galleries/examples/ticks/date_index_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# low, close, volume, adj_close from the mpl-data/sample_data directory. The
# record array stores the date as an np.datetime64 with a day unit ('D') in
# the date column (``r.date``).
r = cbook.get_sample_data('goog.npz')['price_data'].view(np.recarray)
r = cbook.get_sample_data('goog.npz')['price_data'].view(np.rec.recarray)
r = r[:9] # get the first 9 days

fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(6, 6), layout='constrained')
Expand Down
2 changes: 1 addition & 1 deletion galleries/tutorials/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
#
# There are some instances where you have data in a format that lets you
# access particular variables with strings. For example, with
# `numpy.recarray` or `pandas.DataFrame`.
# `numpy.rec.recarray` or `pandas.DataFrame`.
#
# Matplotlib allows you to provide such an object with
# the ``data`` keyword argument. If provided, then you may generate plots with
Expand Down
2 changes: 1 addition & 1 deletion galleries/users_explain/quick_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
# b_asarray = np.asarray(b)
#
# Most methods will also parse an addressable object like a *dict*, a
# `numpy.recarray`, or a `pandas.DataFrame`. Matplotlib allows you to
# `numpy.rec.recarray`, or a `pandas.DataFrame`. Matplotlib allows you to
# provide the ``data`` keyword argument and generate plots passing the
# strings corresponding to the *x* and *y* variables.
np.random.seed(19680801) # seed the random number generator.
Expand Down