【发布时间】:2018-04-19 01:48:20
【问题描述】:
所以我有一个可能很简单的问题。我使用 seaborn 从 excel 文件中的数据创建了一个直方图。为了更好的可视化,我想在条/箱之间留一些空间。这可能吗?
我的代码如下所示
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
%matplotlib inline
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('svg', 'pdf')
df = pd.read_excel('test.xlsx')
sns.set_style("white")
#sns.set_style("dark")
plt.figure(figsize=(12,10))
plt.xlabel('a', fontsize=18)
plt.ylabel('test2', fontsize=18)
plt.title ('tests ^2', fontsize=22)
ax = sns.distplot(st,bins=34, kde=False, hist_kws={'range':(0,1), 'edgecolor':'black', 'alpha':1.0}, axlabel='test1')
第二个问题虽然有点离题,但我如何才能真正提升图表标题中的指数?
谢谢!
【问题讨论】:
-
@jojo:感谢您的链接。我希望能得到更直接的东西。否则我必须将图形导出为 svg 并使用 inkscape 等进行更正。
-
好的,转储问题,我还需要乳胶分配器才能工作吗?
标签: python matplotlib histogram seaborn bins