我使用Seaborn包创建了一个带有重叠stripplot的嵌套boxplot.我在stackoverflow上看到了关于如何使用sns.boxplot生成的ax.artists 为单个框和所有框编辑框属性的答案.
有没有办法用类似的方法编辑whisker,cap,flier等属性?目前我必须手动编辑seaborn - > categorical.py文件中类的restyle_boxplot方法中的值,_BoxPlotter()以从默认绘图到所需的绘图:
这是我的代码供参考:
sns.set_style('whitegrid')
fig1, ax1 = plt.subplots()
ax1 = sns.boxplot(x="Facility", y="% Savings", hue="Analysis",
data=totalSavings)
plt.setp(ax1.artists,fill=False) # <--- Current Artist functionality
ax1 = sns.stripplot(x="Facility", y="% Savings", hue="Analysis",
data=totalSavings, jitter=.05,edgecolor = 'gray',
split=True,linewidth = 0, size = 6,alpha = .6)
ax1.tick_params(axis='both', labelsize=13)
ax1.set_xticklabels(['Test 1','Test 2','Test 3','Test 4','Test 5'], rotation=90)
ax1.set_xlabel('')
ax1.set_ylabel('Percent Savings (%)', fontsize = 14)
handles, labels = ax1.get_legend_handles_labels()
legend1 = plt.legend(handles[0:3], ['A','B','C'],bbox_to_anchor=(1.05, 1), …Run Code Online (Sandbox Code Playgroud) 我正在尝试(并且失败)在Windows 10上使用f2py和Python 3.6 编译fortran模块(特别是来自BGS的igrf12.f).使用Anaconda 4.4.10安装Python.
我的设置:
我按照SciPy文档中的 f2py指示和Dr.Michael Hirsch 的非常有用的指导.Dr.Hirsch创建了pyigrf12模块,但是通过pip安装失败了,这最初引起了我对f2py的兴趣.
我将概述我正在使用的一些方法.无论方法如何,我总是首先使用f2py igrf12.f -m pyigrf12 -h igrf12.pyf并适当地添加intent(in/out)属性来创建*.pyf签名文件.
--compiler=mingw32--compiler=msvc--compiler=mingw32--compiler=msvc方法1:
对于后台,我在C:\ MinGW有MinGW,我已将C:\ MinGW\bin添加到我的用户Path.不幸的是,我没有安装这个版本的MinGW(我从同事那里继承了这台电脑),所以我不知道它的来源.gcc --version和gfortran --version是5.3.0.
我跑f2py -c igrf12.pyf igrf12.f --compiler=mingw32.此失败并显示以下错误消息:
Building import library (arch=AMD64):
"C:\Users\Sholes\AppData\Local\Continuum\anaconda3\libs\libpython36.a"
(from C:\Users\Sholes\AppData\Local\Continuum\anaconda3\python36.dll)
objdump.exe: C:\Users\Sholes\AppData\Local\Continuum\anaconda3\python36.dll: File format not recognized
Traceback (most recent call last):
File "C:\Users\Sholes\AppData\Local\Continuum\anaconda3\Scripts\\f2py.py", line 28, in …Run Code Online (Sandbox Code Playgroud) anaconda ×1
boxplot ×1
f2py ×1
matplotlib ×1
mingw ×1
pandas ×1
python ×1
python-3.6 ×1
seaborn ×1
windows-10 ×1