MCPcopy Create free account
hub / github.com/scikit-learn/scikit-learn / create_axes

Function create_axes

examples/preprocessing/plot_all_scaling.py:123–163  ·  view source on GitHub ↗
(title, figsize=(16, 6))

Source from the content-addressed store, hash-verified

121
122
123def create_axes(title, figsize=(16, 6)):
124 fig = plt.figure(figsize=figsize)
125 fig.suptitle(title)
126
127 # define the axis for the first plot
128 left, width = 0.1, 0.22
129 bottom, height = 0.1, 0.7
130 bottom_h = height + 0.15
131 left_h = left + width + 0.02
132
133 rect_scatter = [left, bottom, width, height]
134 rect_histx = [left, bottom_h, width, 0.1]
135 rect_histy = [left_h, bottom, 0.05, height]
136
137 ax_scatter = plt.axes(rect_scatter)
138 ax_histx = plt.axes(rect_histx)
139 ax_histy = plt.axes(rect_histy)
140
141 # define the axis for the zoomed-in plot
142 left = width + left + 0.2
143 left_h = left + width + 0.02
144
145 rect_scatter = [left, bottom, width, height]
146 rect_histx = [left, bottom_h, width, 0.1]
147 rect_histy = [left_h, bottom, 0.05, height]
148
149 ax_scatter_zoom = plt.axes(rect_scatter)
150 ax_histx_zoom = plt.axes(rect_histx)
151 ax_histy_zoom = plt.axes(rect_histy)
152
153 # define the axis for the colorbar
154 left, width = width + left + 0.13, 0.01
155
156 rect_colorbar = [left, bottom, width, height]
157 ax_colorbar = plt.axes(rect_colorbar)
158
159 return (
160 (ax_scatter, ax_histy, ax_histx),
161 (ax_scatter_zoom, ax_histy_zoom, ax_histx_zoom),
162 ax_colorbar,
163 )
164
165
166def plot_distribution(axes, X, y, hist_nbins=50, title="", x0_label="", x1_label=""):

Callers 1

make_plotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…