Plotly plots.
Class |
|
An interactive Plotly heatmap. |
Class |
|
Wrapper class that turns a Plotly figure containing one or more scatter-type traces into an fiftyone.core.plots.base.InteractivePlot . |
Class |
|
Base class for fiftyone.core.plots.base.InteractivePlot instances with Plotly backends. |
Class |
|
A wrapper around a Plotly plot for Jupyter notebook contexts that allows it to be replaced with a screenshot by calling freeze . |
Class |
|
Mixin for Plotly plots that use widgets to display in Jupyter notebooks. |
Function | get |
Generates a continuous colormap with the specified number of colors from the given plotly colorscale. |
Function | lines |
Plots the given lines(s) data. |
Function | location |
Generates an interactive scatterplot of the given location coordinates with a map rendered in the background of the plot. |
Function | plot |
Plots a confusion matrix. |
Function | plot |
Plots a precision-recall (PR) curve. |
Function | plot |
Plots a set of per-class precision-recall (PR) curves. |
Function | plot |
Plots the given regression results. |
Function | plot |
Plots a receiver operating characteristic (ROC) curve. |
Function | scatterplot |
Generates an interactive scatterplot of the given points. |
Variable | logger |
Undocumented |
Function | _check |
Undocumented |
Function | _compute |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _make |
Undocumented |
Function | _make |
Undocumented |
Function | _parse |
Undocumented |
Function | _patch |
Attempts to patch an unresolved issue with zooming/panning FigureWidgets with Mapbox plots. |
Function | _plot |
Undocumented |
Function | _plot |
Undocumented |
Function | _plot |
Undocumented |
Function | _plot |
Undocumented |
Function | _plot |
Undocumented |
Function | _plot |
Undocumented |
Function | _plot |
Undocumented |
Function | _plot |
Undocumented |
Function | _plot |
Undocumented |
Function | _set |
Undocumented |
Function | _to |
Undocumented |
Constant | _DEFAULT |
Undocumented |
Constant | _DEFAULT |
Undocumented |
Constant | _DEFAULT |
Undocumented |
Constant | _MAX |
Undocumented |
Generates a continuous colormap with the specified number of colors from the given plotly colorscale.
The provided colorscale can be any of the following:
The string name of any colorscale recognized by plotly. See https://plotly.com/python/colorscales for possible options
A manually-defined colorscale like the following:
[ [0.000, "rgb(165,0,38)"], [0.111, "rgb(215,48,39)"], [0.222, "rgb(244,109,67)"], [0.333, "rgb(253,174,97)"], [0.444, "rgb(254,224,144)"], [0.555, "rgb(224,243,248)"], [0.666, "rgb(171,217,233)"], [0.777, "rgb(116,173,209)"], [0.888, "rgb(69,117,180)"], [1.000, "rgb(49,54,149)"], ]
The colorscale will be sampled evenly at the required resolution in order to generate the colormap.
Parameters | |
colorscale | a valid colorscale. See above for possible options |
n:256 | the desired number of colors |
hexFalse | whether to return #RRGGBB hex strings rather than (R, G, B) tuples |
Returns | |
a list of (R, G, B) tuples in [0, 255] , or, if hex_strs is
True, a list of #RRGGBB strings |
Plots the given lines(s) data.
You can attach plots generated by this method to an App session via its
fiftyone.core.session.Session.plots
attribute, which will
automatically sync the session's view with the currently selected points in
the plot. To enable this functionality, you must pass samples to this
method.
You can use the sizes parameter to scale the sizes of the points.
Parameters | |
x:None | the x data to plot. Can be any of the following:
|
y:None | the y data to plot. Can be any of the following:
|
samples:None | the fiftyone.core.collections.SampleCollection
whose data is being visualized |
ids:None | an array-like of IDs of same shape as y. If not provided but samples are provided, the appropriate IDs will be extracted from the samples |
linkNone | a field of samples whose data corresponds to y. Can be any of the following:
|
sizes:None | data to use to scale the sizes of the points. Can be any of the following:
|
labels:None | a name or list of names for the line traces |
colors:None | a list of colors to use for the line traces. See https://plotly.com/python/colorscales for options |
markerNone | the marker size to use. If sizes are provided, this value is used as a reference to scale the sizes of all points |
figure:None | a plotly:plotly.graph_objects.Figure to which
to add the plot |
title:None | a title for the plot |
xaxisNone | an x-axis title |
yaxisNone | a y-axis title |
sizesNone | a title string to use for sizes in the tooltip. By default, if sizes is a field name, this name will be used, otherwise the tooltip will use "size" |
axisFalse | whether to set the axes to equal scale |
**kwargs | optional keyword arguments for
plotly:plotly.graph_objects.Figure.update_layout |
Returns | |
one of the following
|
Generates an interactive scatterplot of the given location coordinates with a map rendered in the background of the plot.
Location data is specified via the locations parameter.
You can attach plots generated by this method to an App session via its
fiftyone.core.session.Session.plots
attribute, which will
automatically sync the session's view with the currently selected points in
the plot. To enable this functionality, you must pass samples to this
method.
You can use the labels parameters to define a coloring for the points, and you can use the sizes parameter to scale the sizes of the points.
Parameters | |
locations:None | the location data to plot. Can be any of the following:
|
samples:None | the fiftyone.core.collections.SampleCollection
whose data is being visualized |
ids:None | an array-like of IDs corresponding to the locations. If not provided but samples are provided, the appropriate IDs will be extracted from the samples |
labels:None | data to use to color the points. Can be any of the following:
|
sizes:None | data to use to scale the sizes of the points. Can be any of the following:
|
edges:None | a num_edges x 2 array-like of row indices into locations defining undirected edges between points to render as a separate trace on the scatterplot |
classes:None | a list of classes whose points to plot. Only applicable when labels contains strings. If provided, the element order of this list also controls the z-order and legend order of multitrace plots (first class is rendered first, and thus on the bottom, and appears first in the legend) |
style:None | the plot style to use. Only applicable when the color data is numeric. Supported values are ("scatter", "density") |
radius:None | the radius of influence of each lat/lon point. Only applicable when style is "density". Larger values will make density plots smoother and less detailed |
figure:None | a plotly:plotly.graph_objects.Figure to which
to add the plot |
multiNone | whether to render each class as a separate trace. Only applicable when labels contains strings. By default, this will be true if there are up to 25 classes |
markerNone | the marker size to use. If sizes are provided, this value is used as a reference to scale the sizes of all points |
colorscale:None | a plotly colorscale to use. Only applicable when labels contains numeric data. See https://plotly.com/python/colorscales for options |
logFalse | whether to apply the colorscale on a log scale. This is useful to better visualize variations in smaller values when large values are also present |
title:None | a title for the plot |
traceNone | a name for the scatter trace. Only applicable when plotting a single trace |
labelsNone | a title string to use for labels in the tooltip and the colorbar title. By default, if labels is a field name, this name will be used, otherwise the colorbar will not have a title and the tooltip will use "label" |
sizesNone | a title string to use for sizes in the tooltip. By default, if sizes is a field name, this name will be used, otherwise the tooltip will use "size" |
edgesNone | a title string to use for edges in the legend. If none is provided, edges are not included in the legend |
showNone | whether to show the colorbar title. By default, a title will be shown only if a value was passed to labels_title or an appropriate default can be inferred from the labels parameter |
map | the map type to render. Supported values are ("roadmap", "satellite") |
**kwargs | optional keyword arguments for
plotly:plotly.graph_objects.Figure.update_layout |
Returns | |
one of the following
|
Plots a confusion matrix.
If ids are provided, this method returns a InteractiveHeatmap
that you can attach to an App session via its
fiftyone.core.session.Session.plots
attribute, which will
automatically sync the session's view with the currently selected cells in
the confusion matrix.
Parameters | |
confusion | a num_true x num_preds confusion matrix |
labels | a max(num_true, num_preds) array-like of class labels |
ids:None | an array-like of same shape as confusion_matrix whose elements are array-likes of label IDs corresponding to each cell |
samples:None | the fiftyone.core.collections.SampleCollection
for which the confusion matrix was generated. Only used when
ids are also provided to update an attached session |
evalNone | the evaluation key of the evaluation |
gtNone | the name of the ground truth field |
predNone | the name of the predictions field |
colorscale:"oranges" | a plotly colorscale to use. See https://plotly.com/python/colorscales for options |
logFalse | whether to apply the colorscale on a log scale. This is useful to better visualize variations in smaller values when large values are also present |
title:None | a title for the plot |
**kwargs | optional keyword arguments for
plotly:plotly.graph_objects.Figure.update_layout |
Returns | |
one of the following
|
Plots a precision-recall (PR) curve.
Parameters | |
precision | an array-like of precision values |
recall | an array-like of recall values |
thresholds:None | an array-like of decision thresholds |
label:None | a label for the curve |
style:"area" | a plot style to use. Supported values are ("area", "line") |
figure:None | a plotly:plotly.graph_objects.Figure to which
to add the plot |
title:None | a title for the plot |
**kwargs | optional keyword arguments for
plotly:plotly.graph_objects.Figure.update_layout |
Returns | |
one of the following
|
Plots a set of per-class precision-recall (PR) curves.
Parameters | |
precisions | a num_classes x num_recalls array-like of per-class precision values |
recall | an array-like of recall values |
classes | the list of classes |
thresholds:None | a num_classes x num_recalls array-like of decision thresholds |
figure:None | a plotly:plotly.graph_objects.Figure to which
to add the plots |
title:None | a title for the plot |
**kwargs | optional keyword arguments for
plotly:plotly.graph_objects.Figure.update_layout |
Returns | |
one of the following
|
Plots the given regression results.
If IDs are provided and you are working in a notebook environment with the
default plotly backend, this method returns an InteractiveScatter
plot that you can attach to an App session via its
fiftyone.core.session.Session.plots
attribute, which will
automatically sync the session's view with the currently selected points in
the plot.
Parameters | |
ytrue | an array-like of ground truth values |
ypred | an array-like of predicted values |
samples:None | the fiftyone.core.collections.SampleCollection
for which the results were generated. Only used by the "plotly"
backend when IDs are provided |
ids:None | an array-like of IDs corresponding to the regressions |
labels:None | data to use to color the points. Can be any of the following:
|
sizes:None | data to use to scale the sizes of the points. Can be any of the following:
|
classes:None | a list of classes whose points to plot. Only applicable when labels contains strings. If provided, the element order of this list also controls the z-order and legend order of multitrace plots (first class is rendered first, and thus on the bottom, and appears first in the legend) |
gtNone | the name of the ground truth field |
predNone | the name of the predictions field |
figure:None | a plotly:plotly.graph_objects.Figure to which
to add the plot |
bestNone | a custom legend label for the best fit line |
markerNone | the marker size to use. If sizes are provided, this value is used as a reference to scale the sizes of all points |
title:None | a title for the plot |
labelsNone | a title string to use for labels in the tooltip and the colorbar title. By default, if labels is a field name, this name will be used, otherwise the colorbar will not have a title and the tooltip will use "label" |
sizesNone | a title string to use for sizes in the tooltip. By default, if sizes is a field name, this name will be used, otherwise the tooltip will use "size" |
showNone | whether to show the colorbar title. By default, a title will be shown only if a value was passed to labels_title or an appropriate default can be inferred from the labels parameter |
**kwargs | optional keyword arguments for
plotly:plotly.graph_objects.Figure.update_layout |
Returns | |
one of the following
|
Plots a receiver operating characteristic (ROC) curve.
Parameters | |
fpr | an array-like of false positive rates |
tpr | an array-like of true positive rates |
thresholds:None | an array-like of decision thresholds |
rocNone | the area under the ROC curve |
style:"area" | a plot style to use. Supported values are ("area", "line") |
figure:None | a plotly:plotly.graph_objects.Figure to which
to add the plot |
title:None | a title for the plot |
**kwargs | optional keyword arguments for
plotly:plotly.graph_objects.Figure.update_layout |
Returns | |
one of the following
|
Generates an interactive scatterplot of the given points.
You can attach plots generated by this method to an App session via its
fiftyone.core.session.Session.plots
attribute, which will
automatically sync the session's view with the currently selected points in
the plot. To enable this functionality, you must pass samples to this
method.
This method supports 2D or 3D visualizations, but interactive point selection is only available in 2D.
You can use the labels parameters to define a coloring for the points, and you can use the sizes parameter to scale the sizes of the points.
Parameters | |
points | a num_points x num_dims array-like of points |
samples:None | the fiftyone.core.collections.SampleCollection
whose data is being visualized |
ids:None | an array-like of IDs corresponding to the points. If not provided but samples are provided, the appropriate IDs will be extracted from the samples |
linkNone | a field of samples whose data corresponds to points. Can be any of the following:
|
labels:None | data to use to color the points. Can be any of the following:
|
sizes:None | data to use to scale the sizes of the points. Can be any of the following:
|
edges:None | a num_edges x 2 array of row indices into points defining undirected edges between points to render as a separate trace on the scatterplot |
classes:None | a list of classes whose points to plot. Only applicable when labels contains strings. If provided, the element order of this list also controls the z-order and legend order of multitrace plots (first class is rendered first, and thus on the bottom, and appears first in the legend) |
figure:None | a plotly:plotly.graph_objects.Figure to which
to add the plot |
multiNone | whether to render each class as a separate trace. Only applicable when labels contains strings. By default, this will be true if there are up to 25 classes |
markerNone | the marker size to use. If sizes are provided, this value is used as a reference to scale the sizes of all points |
colorscale:None | a plotly colorscale to use. Only applicable when labels contains numeric data. See https://plotly.com/python/colorscales for options |
logFalse | whether to apply the colorscale on a log scale. This is useful to better visualize variations in smaller values when large values are also present |
title:None | a title for the plot |
traceNone | a name for the scatter trace. Only applicable when plotting a single trace |
labelsNone | a title string to use for labels in the tooltip and the colorbar title. By default, if labels is a field name, this name will be used, otherwise the colorbar will not have a title and the tooltip will use "label" |
sizesNone | a title string to use for sizes in the tooltip. By default, if sizes is a field name, this name will be used, otherwise the tooltip will use "size" |
edgesNone | a title string to use for edges in the legend. If none is provided, edges are not included in the legend |
showNone | whether to show the colorbar title. By default, a title will be shown only if a value was passed to labels_title or an appropriate default can be inferred from the labels parameter |
axisFalse | whether to set the axes to equal scale |
**kwargs | optional keyword arguments for
plotly:plotly.graph_objects.Figure.update_layout |
Returns | |
one of the following
|
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented