# Generate custom dynamic custom labels given corresponding tick values

**URL:** <https://community.plotly.com/t/generate-custom-dynamic-custom-labels-given-corresponding-tick-values/54611>\
**Category:** 📊 Plotly Python\
**Created:** [July 9, 2021, 5:19pm UTC](https://community.plotly.com/t/generate-custom-dynamic-custom-labels-given-corresponding-tick-values/54611 "2021-07-09T17:19:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkapz](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bkapz](https://community.plotly.com/u/bkapz)\
**Post date:** [July 9, 2021, 5:19pm UTC](https://community.plotly.com/t/generate-custom-dynamic-custom-labels-given-corresponding-tick-values/54611/1 "2021-07-09T17:19:22Z")

</div>

Hi, so I currently have a sequence of strings (years and months) called labels and a corresponding sequence of integers (the number of months) called x\_ticks for one axis. Right now, I can manually choose the ticks in a Surface plot by first feeding in tickvals=x\_ticks and ticktext=labels.take(x\_ticks) inside scene.xaxis. However, I can’t dynamically adjust the labels based on the current ticks chosen. Ideally I’d just like to set nticks, have the tick marks be chosen automatically, and then have the label change when you zoom in by looking up the corresponding entry in tick text. Same idea for displaying the hover text for the x value. Is this possible?
