Plot Graph¶

Plot a graph.

In [ ]:
# OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks
import osmnx as ox

ox.config(use_cache=True, log_console=False)
ox.__version__
Out[ ]:
'1.1.2'
In [ ]:
query = '회현동, 중구, 서울특별시, 대한민국'
network_type = 'drive' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create graph from OSM within the boundaries of some geocodable place(s).
G = ox.graph_from_place(query, network_type=network_type)

# Plot a graph.
fig, ax = ox.plot_graph(
    G, ax=None, figsize=(8, 8), 
    bgcolor='#111111', 
    node_color='w', 
    node_size=15, 
    node_alpha=None, 
    node_edgecolor='none', 
    node_zorder=1, 
    edge_color='#999999', 
    edge_linewidth=1, 
    edge_alpha=None, 
    show=True, 
    close=False, 
    save=False, 
    filepath=None, 
    dpi=300, 
    bbox=None)
/Users/junhyun/.pyenv/versions/3.8.5/envs/gis/lib/python3.8/site-packages/osmnx/geocoder.py:110: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  gdf = gdf.append(_geocode_query_to_gdf(q, wr, by_osmid))