Skip to content

weird behavior of hover text for surfacecolor  #4586

Open
@surasakcho

Description

@surasakcho

image
From the above image, I use the Mt. Bruno's z_data for both z axis and surfacecolor.
The surface graph is correct, but the hover text of surfacecolor is wrong.
The correct surfacecolor text should be 372.8826 same as z's text.

import numpy as np
import plotly
import plotly.graph_objects as go
import pandas as pd

# Read data from a csv
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')

fig = go.Figure(data=[
    go.Surface(
        z=z_data.values, 
        surfacecolor=z_data.values, 
        hovertemplate='x=%{x}, y=%{y}<br>z=%{z}<br>surfacecolor=%{surfacecolor}')])

fig.update_layout(title=f'Mt Bruno Elevation (plotly v.{plotly.__version__})', autosize=False,
                  width=500, height=500,
                  margin=dict(l=65, r=50, b=65, t=90))

fig.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokensev-3annoyance with workaround

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions