Please, can anyone help me, I am tring to plot three plots in one layout one of them should be parallel coordinates as subplot.
I already plotted cos, sin and sin but, when I change one of them to parallel coordinates I got un error message:
ValueError: Invalid property specified for object of type plotly.graph_objs.Parcoords: ‘xaxis’
Valid properties:
customdata
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note
that, "scatter" traces also appends customdata items in
the markers DOM elements
customdatasrc
Sets the source reference on plot.ly for customdata .
dimensions
The dimensions (variables) of the parallel coordinates
chart. 2..60 dimensions are supported.
dimensiondefaults
When used in a template (as
layout.template.data.parcoords.dimensiondefaults), sets
the default property values to use for elements of
parcoords.dimensions
domain
plotly.graph_objs.parcoords.Domain instance or dict
with compatible properties
ids
Assigns id labels to each datum. These ids for object
constancy of data points during animation. Should be an
array of strings, not numbers or any other type.
idssrc
Sets the source reference on plot.ly for ids .
labelfont
Sets the font for the `dimension` labels.
line
plotly.graph_objs.parcoords.Line instance or dict with
compatible properties
name
Sets the trace name. The trace name appear as the
legend item and on hover.
rangefont
Sets the font for the `dimension` range values.
stream
plotly.graph_objs.parcoords.Stream instance or dict
with compatible properties
tickfont
Sets the font for the `dimension` tick values.
uid
Assign an id to this trace, Use this to provide object
constancy between traces during animations and
transitions.
uirevision
Controls persistence of some user-driven changes to the
trace: `constraintrange` in `parcoords` traces, as well
as some `editable: true` modifications such as `name`
and `colorbar.title`. Defaults to `layout.uirevision`.
Note that other user-driven trace attribute changes are
controlled by `layout` attributes: `trace.visible` is
controlled by `layout.legend.uirevision`,
`selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)`
(accessible with `config: {editable: true}`) is
controlled by `layout.editrevision`. Trace changes are
tracked by `uid`, which only falls back on trace index
if no `uid` is provided. So if your app can add/remove
traces before the end of the `data` array, such that
the same trace has a different index, you can still
preserve user-driven changes if you give each trace a
`uid` that stays with it as it moves.
visible
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as
a legend item (provided that the legend itself is
visible).
My code is
import numpy as np
import plotly.graph_objs as go
from plotly import tools
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
fig = tools.make_subplots(rows=1, cols=3);
xi = np.linspace(-np.pi/2, np.pi/2);
cos = go.Scatter(
name=‘cos(x)’,
x=xi,
y=np.cos(xi)
);
sin = go.Scatter(
name=‘sin(x)’,
x=xi,
y=np.sin(xi),
mode = ‘markers’
);
par_coord_plot = go.Parcoords(
line = dict(color = ‘blue’),
dimensions = list([
dict(range = [1,5],
constraintrange = [1,2],
label = ‘A’, values = [1,4]),
dict(range = [1.5,5],
tickvals = [1.5,3,4.5],
label = ‘B’, values = [3,1.5]),
dict(range = [1,5],
tickvals = [1,2,4,5],
label = ‘C’, values = [2,4],
ticktext = [‘text 1’, ‘text 2’, ‘text 3’, ‘text 4’]),
dict(range = [1,5],
label = ‘D’, values = [4,2])
])
);
fig.append_trace(cos, 1, 1);
fig.append_trace(sin, 1, 2);
#fig.append_trace(sin, 1, 3);
fig.append_trace(par_coord_plot, 1, 3);
plot(fig)