Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Fix deprecations in examples#10385
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The normal colorbar works fine if calling colorbar.set_ticks instead ofcolobar.ax.set_ticks, which is noted in the deprecation warning. Thereis no real benefit of showing the axes_grid1 version now.
Unfortunately, csv2rec provides some automatic converters, so it can'tbe replaced entirely with np.genfromtxt or np.loadtxt.
There are also a few warnings about |
62a7788
toc4197df
Comparedatafile = cbook.get_sample_data('msft.csv', asfileobj=False) | ||
print('loading %s' % datafile) | ||
r = csv2rec(datafile)[-40:] | ||
r = np.genfromtxt(datafile, delimiter=',', names=True, |
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.
Maybe use a more telling name likemsft_data
instead ofr
?
Oh, hmmm, that should give a warning, but for constrained layout, not tight layout! Ooops..
|
@jklymak Actually, I was referring to the examples, not the tests. For example,
|
c4197df
to5193922
CompareThe last one is mine, and on purpose to show the failure in the tutorial. The |
@@ -2411,8 +2411,11 @@ def plotfile(fname, cols=(0,), plotfuncs=None, | |||
if plotfuncs is None: | |||
plotfuncs = dict() | |||
r = mlab.csv2rec(fname, comments=comments, skiprows=skiprows, | |||
checkrows=checkrows, delimiter=delimiter, names=names) | |||
from matplotlib.cbook import mplDeprecation |
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.
Should this whole method be deprecated since it depends oncsv2rec
?
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.
Yes, and point people at pandas.
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.
You want to deprecateplt.plotfile
for Pandas? Probably should be an independent PR.
PR Summary
This fixes several deprecation warnings that are triggered by the examples.
Currently,
plt.plotfile
callsmlab.csv2rev
, which is deprecated. Because that function provides some automatic converters, I could not replace it withnp.genfromtxt
ornp.loadtxt
right away, as that would be a behaviour change. Even the examples take advantage of this behaviour.plt.plotfile
also triggers a warning about re-using anAxes
spec. I have not looked too deeply into fixing that one.PR Checklist