Note: this is fixed in 1.4.3 or later
I use the Seaborn plotting package and I just upgraded to the newest version of Matplotlib. Now, plots with dot symbols no longer render. Code that was functional before now creates blank plots, but only when Seaborn is imported. Here's some sample code:
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
print matplotlib.__version__
Matplotlib version:
1.4.2
Create a plot without seaborn:
x = np.linspace(0,2,101)
y = np.sin(2*np.pi*x)
plt.plot(x,y,'.')
Import seaborn, print the version:
import seaborn as sns
print sns.__version__
Seaborn version:
0.4.0
Create a line plot with seaborn imported:
plt.plot(x,y,'-')
Creating a dot plot with seaborn imported gives a blank set of axes:
plt.plot(x,y,'.')
Everything above was done in the IPython notebook, but I just tried the following in Spyder with the same result:
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
print matplotlib.__version__
x = np.linspace(0,2,101)
y = np.sin(2*np.pi*x)
plt.figure()
plt.plot(x,y,'.')
import seaborn as sns
print sns.__version__
plt.figure()
plt.plot(x,y,'-')
plt.figure()
plt.plot(x,y,'.')
plt.show()
What's going on?
It would appear that this is due to a bug in Matplotlib.
https://github.com/matplotlib/matplotlib/issues/3711
https://github.com/mwaskom/seaborn/issues/344
You might just have to downgrade for the time being.
PS: What's up Doug.
A workaround (mentioned in the GitHub links in the other answer) is to explicitly set markeredgewidth
(or mew
) in the call to plot
:
plt.plot(x,y,'.', mew=1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With