Closed
Description
This is not exactly a bug, but a request for improvement of an old limitation.
Apparently for a while the extend keyword argument doesn't work with log scales. I was hoping that this would be fixed with version 2, since it seems like an easy thing to do, but it persists. Is there any plans for getting this feature in a near future? Below is a code to reproduce this limitation.
import matplotlib.pyplot as plt
import numpy as np
from numpy import ma
from matplotlib import colors, ticker, cm
from matplotlib.mlab import bivariate_normal
N = 100
x = np.linspace(-3.0, 3.0, N)
y = np.linspace(-2.0, 2.0, N)
X, Y = np.meshgrid(x, y)
z = (bivariate_normal(X, Y, 0.1, 0.2, 1.0, 1.0)
+ 0.1 * bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0))
cs = plt.contourf(X, Y, z, locator=ticker.LogLocator(), cmap=cm.PuBu_r, extend='both')
cbar = plt.colorbar()
plt.show()
And here is the output of the code above.
Traceback (most recent call last):
File "logn.py", line 13, in <module>
cs = plt.contourf(X, Y, z, locator=ticker.LogLocator(), cmap=cm.PuBu_r, extend='both')
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 2875, in contourf
ret = ax.contourf(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 1892, in inner
return func(ax, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_axes.py", line 5829, in contourf
contours = mcontour.QuadContourSet(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/contour.py", line 846, in __init__
raise ValueError('extend kwarg does not work yet with log '
ValueError: extend kwarg does not work yet with log scale
Thank you very much.