map_display.py 599 B

1234567891011121314151617181920
  1. """
  2. 仅绘制地图
  3. """
  4. import matplotlib.pyplot as plt
  5. import input.make_map as mp
  6. def map_display(map_scene):
  7. picture_scene = map_scene.replace('/', '/').replace('.json', '.jpg')
  8. picture = plt.imread(picture_scene)
  9. ox, oy,sp,gp = mp.make_map(map_scene)
  10. plt.rcParams['xtick.direction'] = 'in'
  11. plt.cla()
  12. plt.plot(ox, oy, ",k")
  13. plt.tick_params(axis='x', direction='in', top=True, bottom=False, labelbottom=False, labeltop=True)
  14. plt.axis("equal")
  15. plt.imshow(picture, extent=[min(ox), max(ox), min(oy), max(oy)])
  16. print("绘制地图结束!")
  17. plt.show()