当我使用节目()我得到了整个迷宫,而当我使用savefig保存同一个图像时,最后一行和正在绘制的列会被裁剪/切断。你知道吗
这是用来绘制迷宫的代码。(我附上了迷宫的截图。)
def maze_plot_final(maze):
fig, ax = plt.subplots()
ax.cla()
cmap = plt.cm.get_cmap()
cmap.set_bad("white")
ax.imshow(maze, cmap=cmap)
plt.savefig('figs/dfs-new.png', dpi=1000, bbox_inches='tight',)
This is the screenshot of the image generated by savefig
This is the screenshot of the last part of maze shown by plt.show
在保存之前您是否尝试过设置轴限制?你知道吗
其中tuple_x:
相关问题 更多 >
编程相关推荐