Hi There,
I’m trying to set the labels for the axes in the code below. I was just trying to start with basic labels, and then was going to adjust the tickvals on the x-axis with #ticktext=[‘C’, ‘D’, …]
However, I keep getting this error:
ValueError: Invalid property specified for object of type plotly.graph_objs.Scatter: ‘transforms’
If you have any advice here, I’d appreciate it!
x = df_transform.key
y = df_transform.tempo
data = [dict(
type = ‘scatter’,
x = x,
y = y,
mode = ‘markers’,
transforms = [dict(
type = ‘groupby’,
groups = key,
styles = [
dict(target = 0.0, value = dict(marker = dict(color = ‘rgb(244, 92, 66)’))),
dict(target = 1.0, value = dict(marker = dict(color = ‘rgb(244, 178, 65)’))),
dict(target = 2.0, value = dict(marker = dict(color = ‘rgb(244, 244, 65)’))),
dict(target = 3.0, value = dict(marker = dict(color = ‘rgb(133, 244, 65)’))),
dict(target = 4.0, value = dict(marker = dict(color = ‘rgb(17, 104, 46)’))),
dict(target = 5.0, value = dict(marker = dict(color = ‘rgb(15, 226, 202)’))),
dict(target = 6.0, value = dict(marker = dict(color = ‘rgb(14, 81, 226)’))),
dict(target = 7.0, value = dict(marker = dict(color = ‘rgb(138, 100, 209)’))),
dict(target = 8.0, value = dict(marker = dict(color = ‘rgb(219, 15, 226)’))),
dict(target = 9.0, value = dict(marker = dict(color = ‘rgb(155, 10, 68)’))),
dict(target = 10.0, value = dict(marker = dict(color = ‘rgb(130, 126, 127)’))),
dict(target = 11.0, value = dict(marker = dict(color = ‘rgb(117, 42, 42)’)))
]
)]
)]
layout = go.Layout(
xaxis=dict(
title=‘AXIS TITLE’,
titlefont=dict(
family=‘Arial, sans-serif’,
size=18,
color=‘lightgrey’
),
showticklabels=True,
tickangle=45,
tickfont=dict(
family=‘Old Standard TT, serif’,
size=14,
color=‘black’
),
exponentformat=‘e’,
showexponent=‘all’
),
yaxis=dict(
title=‘AXIS TITLE’,
titlefont=dict(
family=‘Arial, sans-serif’,
size=18,
color=‘lightgrey’
),
showticklabels=True,
tickangle=45,
tickfont=dict(
family=‘Old Standard TT, serif’,
size=14,
color=‘black’
),
exponentformat=‘e’,
showexponent=‘all’
)
)
fig = go.Figure(data=data, layout=layout)
iplot(fig, filename=‘axes-labels’)