coexist.plots.access2d#
- coexist.plots.access2d(access_data, resolution=(500, 500), width=0.2, select=<function <lambda>>, epochs=Ellipsis, colorscale='Blues_r', scaled=False, seeds=True)[source]#
Create a Plotly figure showing 2D Voronoi diagram of the error values found in 2D slices of the parameters explored in a coexist.Access run.
- Parameters:
- access_data
coexist.AccessData
orstr
An AccessData object containing all information about an ACCES run; you can initialise it with
coexist.AccessData.read("folder_path")
. Alternatively, supply thefolder_path
directly.- resolution2-tuple,
default
(1000, 1000) The number of pixels in the heatmap / Voronoi diagram shown in the x- and y-dimensions.
- width
float
,default
0.1 The width of the slices as a ratio of the parameter range.
- select
function
,default
lambda
results:results
[:, -1] <numpy.inf
A filtering function used to plot only selected solutions tried, based on an input 2D table results, with columns formatted as [param1, param2, …, param1_std, param2_std, …, overall_std, error_value]. E.g. to only plot solutions with an error value smaller than 100: select = lambda results: results[:, -1] < 100.
- epochs
int
or iterable orEllipsis
,default
Ellipsis
The index or indices of the epochs to plot. An int signifies a single epoch, an iterable (list-like) signifies multiple epochs, while an Ellipsis (…) signifies all epochs.
- colorscale
str
,default
“Blues_r” The colorscale used to colour-code the error value. For a list of possible colorscales, see plotly.com/python/builtin-colorscales.
- seedsbool,
default
True
If True, also plot the points representing parameter combinations tried.
- access_data
- Returns:
plotly.graph_objs.Figure
A Plotly figure containing subplots with the solutions tried. Call the .show() method to display it.
Examples
If coexist.Access(filepath, random_seed = 12345) was run, the directory “access_seed12345” would have been created. Plot its results:
>>> import coexist >>> >>> data = coexist.AccessData.read("access_seed12345") >>> fig = coexist.plots.access2d(data) >>> fig.show()
Or more tersely:
>>> import coexist >>> coexist.plots.access2d("access_seed12345").show()
Only plot the results from epochs 5, 6, 7:
>>> coexist.plots.access2d(data, epochs = [4, 5, 6]).show()
Only plot a slice through a 3D parameter space for fp1 and fp3, with 0.4 < fp2 < 0.6.
>>> coexist.plot_access2d( >>> data, >>> columns = [0, 2] >>> select = lambda res: (res[:, 1] > 0.4) & (res[:, 1] < 0.6), >>> ).show()