【问题标题】:How do I correctly download a map from osmnx as .svg?如何正确从 osmnx 下载地图为 .svg?
【发布时间】:2020-03-13 05:22:09
【问题描述】:

我是 Python 新手。刚刚使用 OSMnx 并想在 Illustrator 中以 svg 格式打开地图。这发布在 GitHub 文档中:

# 您还可以将图形绘制/保存为 SVG,以便稍后在 Illustrator 中使用 fig, ax = ox.plot_graph(G_projected, save=True, file_format='svg')

我在 JupyterLab 中尝试过,它下载到我的文件中,但是当我打开它时,它只是文本。如何正确下载并以 SVG 格式打开? - 谢谢!

【问题讨论】:

    标签: python svg jupyter-notebook openstreetmap osmnx


    【解决方案1】:
    fig, ax = ox.plot_graph(G, save=True, show=False, filename='image', file_format='svg')
    

    运行代码行。它会在您当前的工作目录中创建一个images 子文件夹并保存一个名为image.svg 的SVG 文件。在您选择的 SVG 程序(Adobe Illustrator 等)中打开该文件。

    【讨论】:

    • 当我在 jupyter lab 中运行它时,我得到plot_graph() got an unexpected keyword argument 'filename'。我还尝试使用osmnx.io.save_graph_xml 进行保存。你能更新这个答案吗?
    猜你喜欢
    • 2021-03-11
    • 2020-10-04
    • 2019-04-11
    • 2018-07-29
    • 1970-01-01
    • 2014-06-20
    • 1970-01-01
    • 2018-01-06
    • 1970-01-01
    相关资源
    最近更新 更多