Plotly imshow() shows no arg "text_auto"

I am plotting a heatmap of datetime data, day of week and hour of day. the data was structured to a pivot table to feed into a heatmap.

According to the documentation, there should be an argument for annotations, entitled “text_auto”. However, when I run this code (below), I get an error. I am using Plotly 4.14.3 with Python 3.9

px.imshow(img=df_pivot, aspect=‘auto’,width=900,height=600,
text_auto=True)

How does one create annotations within a heatmap in Plotly?

Hi @plotmaster422 , do you expect something like this:

import plotly.express as px
px.imshow(
    np.random.randint(0,255,size=(20,20)),
    text_auto=True,
    aspect='auto',
    width=900, 
    height=600
)

plotly 5.10.0
python 3.10.6

1 Like

I ended up upgrading to a heatmap (ultimately one that shows variables across dimensions), but the below worked for my use case. The below trace used Histogram2d.

I had some issues concerning the backend of heatmaps, specifically how they handle timeseries data. For my case I was dealing with 168 5-minute intervals. There seemed to be no answer to another with how to format the ticks.

I did manage to sort the x axis using categoryorder, which was much simpler.