Results for
import pandas as pd
import numpy as np
import plotly.express as px
df = pd.DataFrame({"foo": [1, 2, 3]})
px.imshow(df, zmax=2)

Results for
import pandas as pd
import numpy as np
import plotly.express as px
df = pd.DataFrame({"foo": [1, 2, 3, np.nan]})
px.imshow(df, zmax=2)

When df contains np.nan, zmax is not taking effect. Intesrestingly, if zmin is specified at the same time, it works.
Results for
Results for
When
dfcontainsnp.nan,zmaxis not taking effect. Intesrestingly, ifzminis specified at the same time, it works.