Hello,
I’ve scoured the internet and asked several AIs but I can’t get this very simple example to work. I’m hoping I’m missing something obvious. The example below works if you comment out the aaxis
and baxis
dictionaries, if not the page shows up white, and then you can find this error by inspecting the html:
(index):12 Uncaught TypeError: Cannot read properties of undefined (reading '0')
at Z.tickText ((index):12:512759)
at t.exports ((index):12:933902)
at t.exports [as calc] ((index):12:929573)
at b ((index):12:786972)
at w.doCalcdata ((index):12:787096)
at e._doPlot ((index):12:446319)
at e.newPlot ((index):12:442396)
at (index):12:4558090
Example:
import plotly.graph_objects as go
fig = go.Figure()
# Sample data
a_values = [4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6]
b_values = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]
y_values = [2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10]
fig.add_trace(go.Carpet(
a=a_values,
b=b_values,
y=y_values,
aaxis=dict(
tickvals=[4, 4.5, 5, 6],
ticktext=['tacos', 'are', 'very', 'good'],
tickmode='array'
),
baxis=dict(
tickvals=[1, 2, 3],
ticktext=['I', 'love', 'plotly'],
tickmode='array'
)
))
fig.show()
Thanks!