Skip to content

reversescale doesn't reverse colorbar on contour plot with coloring='heatmap' #4430

Description

@harupy

Bug

reversescale: True doesn't reverse the colorbar on a contour plot with {contours: {coloring: 'heatmap'}}.

In the plot below, the colorbar indicates the red region has larger values, but it actually has smaller values.

plotly-issue

Code

var data = [{
  z: [[10, 10.625, 12.5, 15.625, 20],
      [5.625, 6.25, 8.125, 11.25, 15.625],
      [2.5, 3.125, 5., 8.125, 12.5],
      [0.625, 1.25, 3.125, 6.25, 10.625],
      [0, 0.625, 2.5, 5.625, 10]],
  x: [-9, -6, -5 , -3, -1],
  y: [0, 1, 4, 5, 7],
  type: 'contour',
  contours: {
    coloring: 'heatmap'
  },
  reversescale: true,
}];

var layout = {
  title: 'Setting the X and Y Coordinates in a Contour Plot'
};

Plotly.newPlot('myDiv', data, layout);

Codepen

https://codepen.io/harupy/pen/bGNgBOz

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions