| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The normal colorbar works fine if calling colorbar.set_ticks instead of colobar.ax.set_ticks, which is noted in the deprecation warning. There is no real benefit of showing the axes_grid1 version now.
Unfortunately, csv2rec provides some automatic converters, so it can't be replaced entirely with np.genfromtxt or np.loadtxt.
|
There are also a few warnings about tight_layout which I don't know how to fix; maybe @jklymak has an idea. |
Sorry, something went wrong.
| datafile = 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.
Maybe use a more telling name like msft_data instead of r?
Sorry, something went wrong.
|
Oh, hmmm, that should give a warning, but for constrained layout, not tight layout! Ooops.. lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout7[png]
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/figure.py:2269: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
warnings.warn("This figure includes Axes that are not compatible "
|
Sorry, something went wrong.
|
@jklymak Actually, I was referring to the examples, not the tests. For example, generating gallery for gallery/lines_bars_and_markers... [ 97%] markevery_demo.py
/home/circleci/project/lib/matplotlib/figure.py:2269: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
warnings.warn("This figure includes Axes that are not compatible "
generating gallery for tutorials/intermediate... [ 83%] tight_layout_guide.py
/home/circleci/project/lib/matplotlib/gridspec.py:316: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
warnings.warn("This figure includes Axes that are not compatible "
generating gallery for tutorials/intermediate... [100%] constrainedlayout_guide.py
/home/circleci/project/lib/matplotlib/figure.py:2224: UserWarning: Calling figure.constrained_layout, but figure not setup to do constrained layout. You either called GridSpec without the fig keyword, you are using plt.subplot, or you need to call figure or subplotswith the constrained_layout=True kwarg.
warnings.warn("Calling figure.constrained_layout, but figure "
|
Sorry, something went wrong.
|
The last one is mine, and on purpose to show the failure in the tutorial. The tight_layout example is similar, showing that tight_layout doesn't work and emits a warning for colorbars created outside of gridspec. Not sure about the first one. |
Sorry, something went wrong.
| 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.
Should this whole method be deprecated since it depends on csv2rec?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, and point people at pandas.
Sorry, something went wrong.
There was a problem hiding this comment.
You want to deprecate plt.plotfile for Pandas? Probably should be an independent PR.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This fixes several deprecation warnings that are triggered by the examples.
Currently, plt.plotfile calls mlab.csv2rev, which is deprecated. Because that function provides some automatic converters, I could not replace it with np.genfromtxt or np.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 an Axes spec. I have not looked too deeply into fixing that one.
PR Checklist