I have a surface plot and I am trying to change the width of the highlighted contour on hover. It is possible that the highlightwidth
variable that I’m modifying does not do what I think it does or that I am modifying it incorrectly, but changing highlightcolor
works as anticipated. I have attached screenshots when highlightwidth=2
and highlightwidth=16
at the bottom but they appear identical. I couldn’t find another topic that covered this or a bug that mentioned this, but I apologize if I have overlooked something.
In case my language above is wrong, I would like to modify the thickness of the white contour lines (on hover) on the surface in the images below.
Here is a somewhat MWE, taken from plotly’s surface page.
import plotly
import plotly.graph_objects as go
import pandas as pd
import numpy as np
# Read data from a csv
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')
z = z_data.values
sh_0, sh_1 = z.shape
contours = dict(
x=dict(
show=False,
highlight=True,
highlightcolor='white',
highlightwidth=2, %%%% Modify here
usecolormap=False,
project=dict(
x=False,
y=False,
z=False)))
x, y = np.linspace(0, 1, sh_0), np.linspace(0, 1, sh_1)
fig = go.Figure(data=[go.Surface(z=z, x=x, y=y,contours=contours)])
fig.update_layout(title='Mt Bruno Elevation. Width of 2', autosize=False,
width=500, height=500,
margin=dict(l=65, r=50, b=65, t=90))
fig.show()
The above code produces this:
When I modify highlightwidth=16
, the code produces this: