def setup_figure(self):
"""
Prepare the matplotlib figure for plotting.
This method sets the default font, and the overall apearance of the
figure.
"""
if options.cfg.xkcd:
fonts = QtGui.QFontDatabase().families()
for x in ["Humor Sans", "DigitalStrip", "Comic Sans MS"]:
if x in fonts:
self.options["figure_font"] = QtGui.QFont(x, pointSize=self.options["figure_font"].pointSize())
break
else:
for x in ["comic", "cartoon"]:
for y in fonts:
if x.lower() in y.lower():
self.options["figure_font"] = QtGui.QFont(x, pointSize=self.options["figure_font"].pointSize())
break
plt.xkcd()
with sns.plotting_context("paper"):
self.g = sns.FacetGrid(self._table,
col=self._col_factor,
col_wrap=self._col_wrap,
row=self._row_factor,
sharex=True,
sharey=True)
评论列表
文章目录