Matplotlib 1.4.2 with Seaborn: linear markers do not work

Note: this is fixed in 1.4.3 or later


I use the Seaborn plotting package and I just updated it to the latest version of Matplotlib. Charts with dot symbols are no longer displayed. The code that has been functional so far creates empty patches, but only when Seaborn is imported. Here is a sample code:

import matplotlib.pyplot as plt import matplotlib import numpy as np print matplotlib.__version__ 

Matplotlib Version:

 1.4.2 

Create a story without a sea shore:

 x = np.linspace(0,2,101) y = np.sin(2*np.pi*x) plt.plot(x,y,'.') 

sin function with dots at each data point

Import seaport, print version:

 import seaborn as sns print sns.__version__ 

Marine version:

 0.4.0 

Create a line chart with imported sea transport:

 plt.plot(x,y,'-') 

sin function with a solid line connecting each data point

Creating a point with imported sea transport gives an empty set of axes:

 plt.plot(x,y,'.') 

empty axis set

All of the above was done on an IPython laptop, 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 happening?

+6
source share
2 answers

It would seem that this is due to an error in Matplotlib.

https://github.com/matplotlib/matplotlib/issues/3711

https://github.com/mwaskom/seaborn/issues/344

You may need to downgrade at this time.

PS: What a Doug.

+3
source

The workaround (mentioned in GitHub links in another answer) is to explicitly set markeredgewidth (or mew ) in the plot call:

 plt.plot(x,y,'.', mew=1) 
0
source

Source: https://habr.com/ru/post/977380/


All Articles