🏥 🏭 Working on the COVID-19 response in Canada? Plotly & the Canadian government can help you and your organization. Learn more and get in touch.

How to set log scale for z axis on a heatmap?


Is it possible to set log scale for a Z axis on a heatmap?

I’ve tried it this way, but Z axis is still linear:

import plotly.graph_objs as go
data = [
        z=[[1, 200, 3000, 500, 1], [20000, 1, 60, 80, 30], [30, 60, 1, -10, 20]],
        x=['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
        y=['Morning', 'Afternoon', 'Evening'],
py.offline.iplot(dict(data=data, layout={'scene': {'zaxis': {'type': 'log'}}}))

Any help or direction is much appreciated.

plotly heatmaps only support linear z scales at the moment.

I think logs scales are now possible with python plotly as shown in this plotly example

I stumbled across the example as I am trying to figure out how to do the same but in JavaScript