Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heatmap bricks on log axes #5991

Closed
alexcjohnson opened this issue Oct 19, 2021 · 0 comments
Closed

heatmap bricks on log axes #5991

alexcjohnson opened this issue Oct 19, 2021 · 0 comments

Comments

@alexcjohnson
Copy link
Contributor

From the discussion that came up in #5985 - that PR proposed 4 contour plots - on a mixture of log and linear axes - that should look identical but didn't, until fixed in the PR. If we make the same plots as a smoothed heatmap, they look identical as far as the smoothing goes, but we lose the first row of bricks on each log axis because its far edge would be at a negative coordinate:

Also closer to what we already do with smoothed heatmaps (the same mock after Plotly.restyle(gd,{'type':'heatmap', 'zsmooth':'best'}) - the four variants look slightly different but I think this is actually a symptom of some funny and potentially incorrect things we're doing with extending beyond the data values to make the outer edges of the heatmap bricks - we may want to adapt this for log axes too, especially as this results in us dropping the first row/column in this case!):
Screen Shot 2021-10-18 at 12 06 13 PM

Can we do a better job of picking brick edges in this case?

The figure above would be:

{
  "data": [
    {
      "x": [1,2,3,4,5],
      "y": [1,2,3,4,5],
      "z": [
        [0 ,   3.1250,   12.5000,   28.1250,   50.0000],
        [3.1250,    6.2500,   15.6250,   31.2500,   53.1250],
        [12.5000,   15.6250,   25.0000,   40.6250,   62.5000],
        [28.1250,   31.2500,   40.6250,   56.2500,   78.1250],
        [50.0000,   53.1250,   62.5000,   78.1250,  100.0000]
      ],
      "zsmooth": "best",
      "type": "heatmap"
    },
    {
      "x": [1,10,100,1000,10000],
      "y": [1,2,3,4,5],
      "z": [
        [0 ,   3.1250,   12.5000,   28.1250,   50.0000],
        [3.1250,    6.2500,   15.6250,   31.2500,   53.1250],
        [12.5000,   15.6250,   25.0000,   40.6250,   62.5000],
        [28.1250,   31.2500,   40.6250,   56.2500,   78.1250],
        [50.0000,   53.1250,   62.5000,   78.1250,  100.0000]
      ],
      "zsmooth": "best",
      "type": "heatmap",
      "showscale": false,
      "xaxis": "x2"
    },
    {
      "x": [1,2,3,4,5],
      "y": [1,10,100,1000,10000],
      "z": [
        [0 ,   3.1250,   12.5000,   28.1250,   50.0000],
        [3.1250,    6.2500,   15.6250,   31.2500,   53.1250],
        [12.5000,   15.6250,   25.0000,   40.6250,   62.5000],
        [28.1250,   31.2500,   40.6250,   56.2500,   78.1250],
        [50.0000,   53.1250,   62.5000,   78.1250,  100.0000]
      ],
      "zsmooth": "best",
      "type": "heatmap",
      "showscale": false,
      "yaxis": "y2"
    },
    {
      "x": [1,10,100,1000,10000],
      "y": [1,10,100,1000,10000],
      "z": [
        [0 ,   3.1250,   12.5000,   28.1250,   50.0000],
        [3.1250,    6.2500,   15.6250,   31.2500,   53.1250],
        [12.5000,   15.6250,   25.0000,   40.6250,   62.5000],
        [28.1250,   31.2500,   40.6250,   56.2500,   78.1250],
        [50.0000,   53.1250,   62.5000,   78.1250,  100.0000]
      ],
      "zsmooth": "best",
      "type": "heatmap",
      "showscale": false,
      "xaxis": "x2",
      "yaxis": "y2"
    }
  ],
  "layout": {
    "xaxis": {"domain": [0, 0.45]},
    "xaxis2": {"domain": [0.55, 1], "type": "log"},
    "yaxis": {"domain": [0, 0.45]},
    "yaxis2": {"domain": [0.55, 1], "type": "log"},
    "margin": {"l": 50, "b": 50, "r": 110, "t": 10},
    "width": 500,
    "height": 400
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant