my setup is
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
I have scipy 0.17 and cartopy '0.14.2'.
All I'm trying to do is
plt.axes(projection=ccrs.PlateCarree())
and it leads to this:
Traceback (most recent call last):
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2885, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-93-636aeb1a7fc6>", line 1, in <module>
plt.axes(projection=ccrs.PlateCarree())
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/matplotlib/pyplot.py", line 867, in axes
return subplot(111, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/matplotlib/pyplot.py", line 1022, in subplot
a = fig.add_subplot(*args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/matplotlib/figure.py", line 987, in add_subplot
self, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/matplotlib/projections/__init__.py", line 100, in process_projection_requirements
projection_class, extra_kwargs = projection._as_mpl_axes()
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/cartopy/crs.py", line 150, in _as_mpl_axes
import cartopy.mpl.geoaxes as geoaxes
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/cartopy/mpl/geoaxes.py", line 52, in <module>
from cartopy.vector_transform import vector_scalar_to_grid
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/cartopy/vector_transform.py", line 26, in <module>
from scipy.interpolate import griddata
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/scipy/interpolate/__init__.py", line 158, in <module>
from .interpolate import *
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/scipy/interpolate/interpolate.py", line 12, in <module>
import scipy.special as spec
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/scipy/special/__init__.py", line 629, in <module>
from .basic import *
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/scipy/special/basic.py", line 14, in <module>
from ._ufuncs import (ellipkm1, mathieu_a, mathieu_b, iv, jv, gamma, psi, zeta,
ImportError: cannot import name 'zeta'
Deep down this appears to be a scipy problem, but I have the newest there - what's going on here?
It turned out to be a problem with the scipy installation coming from conda. Creating a new environment and freshly installing scipy solved the issue.
Related
I'm just trying to set up a code to plot a skewT graph, but the code falls over immediately on the very first call to set up the graph incidence
import matplotlib.pyplot as plt
from metpy.plots import SkewT
skew=SkewT()
gives me the following traceback, is this a bug in the latest metpy version? (I just upgraded)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/metpy/plots/skewt.py", line 316, in __init__
self.ax = fig.add_subplot(*subplot, projection='skewx', rotation=rotation)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/figure.py", line 772, in add_subplot
ax = subplot_class_factory(projection_class)(self, *args, **pkw)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_subplots.py", line 34, in __init__
self._axes_class.__init__(self, fig, [0, 0, 1, 1], **kwargs)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/metpy/plots/skewt.py", line 195, in __init__
super().__init__(*args, **kwargs)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/_api/deprecation.py", line 456, in wrapper
return func(*args, **kwargs)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_base.py", line 632, in __init__
self.cla()
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_base.py", line 1249, in cla
self.grid(False) # Disable grid on init to use rcParameter
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/_api/deprecation.py", line 299, in wrapper
return func(*args, **kwargs)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_base.py", line 3226, in grid
self.xaxis.grid(visible, which=which, **kwargs)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/_api/deprecation.py", line 299, in wrapper
return func(*args, **kwargs)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axis.py", line 1434, in grid
self.set_tick_params(which='major', **gridkw)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axis.py", line 873, in set_tick_params
for tick in self.majorTicks:
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axis.py", line 592, in __get__
tick = instance._get_tick(major=True)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/metpy/plots/skewt.py", line 134, in _get_tick
return SkewXTick(self.axes, None, label=None, major=major)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axis.py", line 415, in __init__
super().__init__(*args, **kwargs)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/axis.py", line 160, in __init__
self.gridline = mlines.Line2D(
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/lines.py", line 393, in __init__
self.update(kwargs)
File "/Users/tompkins/Library/Python/3.9/lib/python/site-packages/matplotlib/artist.py", line 1064, in update
raise AttributeError(f"{type(self).__name__!r} object "
AttributeError: 'Line2D' object has no property ''
I'm on
Python 3.9.9 (main, Nov 21 2021, 03:23:42)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
and using
metpy.__version__
'1.1.0'
This is caused by the recently released matplotlib 3.5. We are planning on releasing a fix for this with MetPy 1.2, scheduled to be released shortly.
In the meanwhile as a workaround, you'll need to downgrade to matplotlib 3.4.
i am stuck in this error, i know the function "clock" has removed, but the problem is, i cant find the function code in the code
code:
import imageio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from skimage.transform import resize
from IPython.display import HTML
import warnings
warnings.filterwarnings("ignore")
source_image =imageio.imread(r"C:\Users\jpdyb\Documents\first-order\workspace\02.png")
reader =imageio.get_reader(r"C:\Users\jpdyb\Documents\first-order\workspace\04.mp4")
#Resize image and video to 256x256
source_image = resize(source_image, (256, 256))[..., :3]
fps = reader.get_meta_data()['fps']
driving_video = [r"C:\Users\jpdyb\Documents\first-order\workspace\04.mp4"]
try:
for im in reader:
driving_video.append(im)
except RuntimeError:
pass
reader.close()
driving_video = [resize(frame, (256, 256))[..., :3] for frame in driving_video]
def display(source, driving, generated=None):
fig = plt.figure(figsize=(8 + 4 * (generated is not None), 6))
ims = []
for i in range(len(driving)):
cols = [source]
cols.append(driving[i])
if generated is not None:
cols.append(generated[i])
im = plt.imshow(np.concatenate(cols, axis=1), animated=True)
plt.axis('off')
ims.append([im])
ani = animation.ArtistAnimation(fig, ims, interval=50, repeat_delay=1000)
plt.close()
return ani
HTML(display(source_image, driving_video).to_html5_video())
error (python):
Traceback (most recent call last):
File "C:\Users\jpdyb\AppData\Local\Programs\Python\Python39\lib\site-packages\IPython\utils\timing.py", line 27, in <module>
import resource
File "C:\Users\jpdyb\AppData\Roaming\Python\Python39\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'resource'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\jpdyb\Documents\first-order\python system\load images.py", line 6, in <module>
from IPython.display import HTML
File "C:\Users\jpdyb\AppData\Roaming\Python\Python39\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Users\jpdyb\AppData\Local\Programs\Python\Python39\lib\site-packages\IPython\__init__.py", line 49, in <module>
from .terminal.embed import embed
File "C:\Users\jpdyb\AppData\Roaming\Python\Python39\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Users\jpdyb\AppData\Local\Programs\Python\Python39\lib\site-packages\IPython\terminal\embed.py", line 19, in <module>
from IPython.terminal.ipapp import load_default_config
File "C:\Users\jpdyb\AppData\Roaming\Python\Python39\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Users\jpdyb\AppData\Local\Programs\Python\Python39\lib\site-packages\IPython\terminal\ipapp.py", line 30, in <module>
from IPython.core.magics import ScriptMagics
File "C:\Users\jpdyb\AppData\Roaming\Python\Python39\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Users\jpdyb\AppData\Local\Programs\Python\Python39\lib\site-packages\IPython\core\magics\__init__.py", line 21, in <module>
from .execution import ExecutionMagics
File "C:\Users\jpdyb\AppData\Roaming\Python\Python39\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Users\jpdyb\AppData\Local\Programs\Python\Python39\lib\site-packages\IPython\core\magics\execution.py", line 46, in <module>
from IPython.utils.timing import clock, clock2
File "C:\Users\jpdyb\AppData\Roaming\Python\Python39\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Users\jpdyb\AppData\Local\Programs\Python\Python39\lib\site-packages\IPython\utils\timing.py", line 64, in <module>
clocku = clocks = clock = time.clock
AttributeError: module 'time' has no attribute 'clock'
I just want to read a csv file into Pycharm but due to some reason it's not doing it properly.
Here is my code:
import csv
import os
import pandas as pd
path = '/Users/amy/Desktop/data_analysis/additionaldata/df1.csv'
df=pd.read_csv('path', sep=',')
It returned error
Traceback (most recent call last):
File "<input>", line 3, in <module>
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/harper/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/__init__.py", line 55, in <module>
from pandas.core.api import (
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/harper/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/core/api.py", line 24, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/harper/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import ( # noqa: F401
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/amy/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/core/groupby/generic.py", line 44, in <module>
from pandas.core.frame import DataFrame
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/amy/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/core/frame.py", line 114, in <module>
from pandas.core.series import Series
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/amy/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/core/series.py", line 84, in <module>
import pandas.plotting
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/amy/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/plotting/__init__.py", line 59, in <module>
from pandas.plotting._core import (
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/amy/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/plotting/_core.py", line 17, in <module>
import pandas.plotting._matplotlib # noqa
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/amy/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/plotting/_matplotlib/__init__.py", line 3, in <module>
from pandas.plotting._matplotlib.boxplot import (
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/amy/PycharmProjects/testing/venv/lib/python3.7/site-packages/pandas/plotting/_matplotlib/boxplot.py", line 4, in <module>
from matplotlib.artist import setp
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/amy/PycharmProjects/testing/venv/lib/python3.7/site-packages/matplotlib/__init__.py", line 5, in <module>
df=pd.read_csv('path', sep=',')
AttributeError: module 'pandas' has no attribute 'read_csv'
I also tried this
import csv
import os
import pandas as pd
path = '/Users/amy/Desktop'
df=pd.read_csv("df1.csv")
which didn't work either.
What's wrong? I have read a few other posts but still not sure how to do this. Any help is appreciated. Thanks
Simply add open() to open the file before passing it into pandas.read_csv():
import pandas as pd
path = '/Users/amy/Desktop/data_analysis/additionaldata/df1.csv'
df = pd.read_csv(open(path), sep=',')
(Note: 'path' is only a string with value 'path' if you want the actual path, there shouldn't be any brackets.)
The story
pandas, numpy, seaborn, matplotlib are installed on the system without errors. I took this code example from http://seaborn.pydata.org/examples/many_pairwise_correlations.html
Snippet
from string import letters
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white")
# Generate a large random dataset
rs = np.random.RandomState(33)
d = pd.DataFrame(data=rs.normal(size=(100, 26)),
columns=list(letters[:26]))
# Compute the correlation matrix
corr = d.corr()
# Generate a mask for the upper triangle
mask = np.zeros_like(corr, dtype=np.bool)
mask[np.triu_indices_from(mask)] = True
# Set up the matplotlib figure
f, ax = plt.subplots(figsize=(11, 9))
# Generate a custom diverging colormap
cmap = sns.diverging_palette(220, 10, as_cmap=True)
# Draw the heatmap with the mask and correct aspect ratio
sns.heatmap(corr, mask=mask, cmap=cmap, vmax=.3,
square=True, xticklabels=5, yticklabels=5,
linewidths=.5, cbar_kws={"shrink": .5}, ax=ax)
It results in the following error:
Traceback (most recent call last):
File "seaborn-example.py", line 4, in <module>
import seaborn as sns
File "/usr/local/lib/python2.7/site-packages/seaborn/__init__.py", line 6, in <module>
from .rcmod import *
File "/usr/local/lib/python2.7/site-packages/seaborn/rcmod.py", line 8, in <module>
from . import palettes, _orig_rc_params
File "/usr/local/lib/python2.7/site-packages/seaborn/palettes.py", line 12, in <module>
from .utils import desaturate, set_hls_values, get_color_cycle
File "/usr/local/lib/python2.7/site-packages/seaborn/utils.py", line 12, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>
from six.moves import tkinter as Tk
File "/usr/local/lib/python2.7/site-packages/six.py", line 203, in load_module
mod = mod._resolve()
File "/usr/local/lib/python2.7/site-packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/usr/local/lib/python2.7/site-packages/six.py", line 82, in _import_module
__import__(name)
File "/usr/local/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
Referred Install tkinter for Python for installing tkinter
yum install -y tkinter tk-devel
Then I followed this for rebuilding Python
https://github.com/h2oai/h2o-2/wiki/installing-python-2.7-on-centos-6.3.-follow-this-sequence-exactly-for-centos-machine-only
And got this when I tried the rebuilding - still some issue with tkinter:
Traceback (most recent call last):
File "seaborn-example.py", line 22, in <module>
f, ax = plt.subplots(figsize=(11, 9))
File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1203, in subplots
fig = figure(**fig_kw)
File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 535, in figure
**kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 81, in new_figure_manager
return new_figure_manager_given_figure(num, figure)
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 89, in new_figure_manager_given_figure
window = Tk.Tk()
File "/usr/local/lib/python2.7/lib-tk/Tkinter.py", line 1745, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
What is wrong here?
At the beginning of the file
import matplotlib
matplotlib.use('Agg')
I'm trying to plot with seaborn.kdeplot with LaTeX labels. What I tried is the following:
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(font_scale=1.5, rc={'text.usetex' : True})
x = np.linspace(-50,50,100)
y = np.sin(x)**2/x
fig = plt.figure(1)
sns.set_style('white')
sns.kdeplot(np.array(y), label='hey')
fig.gca().set(xlabel=r'$e(t_0)$ [s]', ylabel='PDF')
fig.savefig("seaborntest.png", close = True, verbose = True)
Running this I've got the following error:
Traceback (most recent call last):
File "./sns_problem.py", line 17, in <module>
fig.savefig("seaborntest.png", close = True, verbose = True)
File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1363, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 2093, in print_figure
**kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 491, in print_png
FigureCanvasAgg.draw(self)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 439, in draw
self.figure.draw(self.renderer)
File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 999, in draw
func(*args)
File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/axes.py", line 2086, in draw
a.draw(renderer)
File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/axis.py", line 1050, in draw
renderer)
File "/usr/lib64/python2.7/site-packages/matplotlib/axis.py", line 999, in _get_tick_bboxes
extent = tick.label1.get_window_extent(renderer)
File "/usr/lib64/python2.7/site-packages/matplotlib/text.py", line 752, in get_window_extent
bbox, info = self._get_layout(self._renderer)
File "/usr/lib64/python2.7/site-packages/matplotlib/text.py", line 304, in _get_layout
ismath=False)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 196, in get_text_width_height_descent
texmanager = self.get_texmanager()
File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 597, in get_texmanager
self._texmanager = TexManager()
File "/usr/lib64/python2.7/site-packages/matplotlib/texmanager.py", line 137, in __init__
ff = rcParams['font.family'].lower()
AttributeError: 'list' object has no attribute 'lower'
What could be the problem? The strange thing is that I got this error even if I remove the line adding the labels. What is the proper way of using LaTeX in seaborn plot labels?
If you do not have latex install on your machine, this could be causing errors.
For Linux users try installing Latex:
sudo apt update
sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super
If in notebook, restart the Kernel, and then the font should display using Latex.