我的pandasDataFrame
results_print有2维数组,它们是图像。我是这样打印的:
n_rows = results_print.shape[0]
n_cols = results_print.shape[1]
f, a = plt.subplots(n_cols, n_rows, figsize=(n_rows, n_cols))
methods = ['img', 'sm', 'rbd', 'ft', 'mbd', 'binary_sal', 'sal']
for r in range(n_rows):
for c, cn in zip(range(len(methods)), methods):
a[c][r].imshow(results_print.at[r,cn], cmap='gray')
现在我创建了一个python ggplot image对象:
^{pr2}$如何将gg
作为元素添加到matplotlib网格中?在
我想解决办法是先画出ggplot部分。然后通过
plt.gcf()
获得matplotlib图形对象,通过plt.gca()
获得轴。调整ggplot轴的大小以适合网格,并最终将matplotlib图的其余部分绘制到该图形中。在相关问题 更多 >
编程相关推荐