onoke
onoke

Reputation: 119

Plotly.js: How to set string title on the points

I am quite a starter in Plotly.js. I am very sorry to ask like maybe basic question.

On a scatter3d graph, default ticker on the points shows their axis numbers, like "x:1 y:1 z:1".

I wanna show it other name, like "a"<-"x:1 y:1 z:1", "b"<-"x:2 y:2 z:2"...

Which attribute does work for it?

"ticktext" did not work.:<

ex.

var data = [
    {
        opacity: 0.5,
        type: 'scatter3d',
        x: [1,2,3],
        y: [1,2,3],
        z: [1,2,3],
        mode: 'markers'
    }
];

Best,

Upvotes: 0

Views: 74

Answers (1)

onoke
onoke

Reputation: 119

Using text, for example:

    .
    .
x:[1,2,3],
y:[1,2,3],
z:[1,2,3],
text:["a","b","c"],
    .
    . 

Reference: https://plotly.com/javascript/text-and-annotations

Upvotes: 0

Related Questions