Closed syrte closed 1 year ago
A general temporary workaround for functions that do not work as expected: call the matplotlib version of the plotting function, for example, for the contour function in the above example
mpl.axes._axes.Axes.contour(ax, x, y, z, levels=np.linspace(0, z.max(), 4)[1:-1])
Good workaround idea -- mpl.axes.Axes
should also work. This is a problem with proplot's DiscreteNorm
. Fix was pretty quick (d283935).
Thanks for the quick fix!
Description
contour does not work for 2 levels in proplot.
Steps to reproduce
A "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you.
I got this with warnings:
and an empty figure.
Actual behavior: [What actually happened]![image](https://user-images.githubusercontent.com/7038335/224503742-23fef6df-5c44-4fa5-ac8b-4dd0ca65726f.png)
If I use 3 levels:
It works well.![image](https://user-images.githubusercontent.com/7038335/224503765-238ab0d2-0bfa-43d9-a851-23f5ee2ed5df.png)
Also I confirm that 2 levels work in matplotlib. It confused me for quite a while when I convert my matplotlib code to proplot.
Proplot version
Paste the results of
import matplotlib; print(matplotlib.__version__); import proplot; print(proplot.version)
here.3.4.3 0.9.5.post333