def _jointplot(self, first: RunData, second: RunData, property: str, size: int, filename: str = None,
show_ticks: bool = True):
import matplotlib.pyplot as plt
import seaborn as sns
import numpy
filename = filename or self._get_new_figure_filename()
length = min(len(first[property]), len(second[property]))
first_prop = first[property][0:length]
second_prop = second[property][0:length]
lim = (0, max(max(first_prop), max(second_prop)))
self._set_fig_size(size)
x1 = pd.Series(first_prop, name="{descr}: {prop}".format(descr=first.description(), prop=property))
x2 = pd.Series(second_prop, name="{descr}: {prop}".format(descr=second.description(), prop=property))
plt.xlim(lim)
g = None
try:
g = sns.jointplot(x1, x2, kind=self.misc["pair_kind"], size=size, space=0,
stat_func=self.stats_helper.tester.test, xlim=lim, ylim=lim)
if not show_ticks:
g.ax_joint.set_xticklabels([])
g.ax_joint.set_yticklabels([])
g.savefig(filename)
plt.close()
except BaseException as ex:
logging.warning(ex)
return filename
评论列表
文章目录