示例#1
0
def simple_plot(_G, _path):
    # plot using the selected extents
    plot.plot_nX(_G,
                 labels=False,
                 plot_geoms=True,
                 node_size=10,
                 edge_width=1,
                 x_lim=(min_x, max_x),
                 y_lim=(min_y, max_y),
                 dpi=200,
                 path=_path)
示例#2
0
def simple_plot(_G, _path=None, plot_geoms=True):
    # manual ax for plotting additional circles
    util_funcs.plt_setup()
    # create new plot
    fig, target_ax = plt.subplots(1, 1)
    plot.plot_nX(_G,
                 labels=False,
                 plot_geoms=plot_geoms,
                 node_size=10,
                 edge_width=1,
                 x_lim=(min_x, max_x),
                 y_lim=(min_y, max_y),
                 ax=target_ax)
    if _path is not None:
        plt.savefig(_path, facecolor='#2e2e2e')
    else:
        return target_ax
示例#3
0
import numpy as np
import osmnx as ox
import utm
from matplotlib import colors
from shapely import geometry

from cityseer.metrics import networks, layers
from cityseer.tools import mock, graphs, plot

base_path = os.getcwd()
plt.style.use('matplotlibrc')

###
# INTRO PLOT
G = mock.mock_graph()
plot.plot_nX(G, labels=True, node_size=80, path='images/graph.png', dpi=150)

# INTRO EXAMPLE PLOTS
G = graphs.nX_simple_geoms(G)
G = graphs.nX_decompose(G, 20)

N = networks.NetworkLayerFromNX(G, distances=[400, 800])
N.segment_centrality(measures=['segment_harmonic'])

data_dict = mock.mock_data_dict(G, random_seed=25)
D = layers.DataLayerFromDict(data_dict)
D.assign_to_network(N, max_dist=400)
landuse_labels = mock.mock_categorical_data(len(data_dict), random_seed=25)
D.hill_branch_wt_diversity(landuse_labels, qs=[0])
G_metrics = N.to_networkX()
示例#4
0
import utm
from matplotlib import colors
import matplotlib.pyplot as plt

from cityseer.metrics import networks, layers
from cityseer.tools import mock, graphs, plot

from src import util_funcs


util_funcs.plt_setup()
# INTRO PLOT
G = mock.mock_graph()
plot.plot_nX(G,
             labels=True,
             node_size=80,
             path='../phd-doc/doc/images/cityseer/graph.pdf')


# INTRO EXAMPLE PLOTS
G = graphs.nX_simple_geoms(G)
G = graphs.nX_decompose(G, 20)

N = networks.NetworkLayerFromNX(G, distances=[400, 800])
N.segment_centrality(measures=['segment_harmonic'])

data_dict = mock.mock_data_dict(G, random_seed=25)
D = layers.DataLayerFromDict(data_dict)
D.assign_to_network(N, max_dist=400)
landuse_labels = mock.mock_categorical_data(len(data_dict), random_seed=25)
D.hill_branch_wt_diversity(landuse_labels, qs=[0])