Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Mirroring the X axis

Hi all,

Is it possible to mirror the X Axis on the top and bottom of the chart? Been scouring the docs

I’m not sure if the OP’s problem was solved, but I haven’t been able to get the mirroring to work, either in the X or the Y axis. Unless I’m misinterpreting the docs, a simple chart like the following should show the axis lines, ticks, and scale along both the top and bottom.

 trace1 = {
  x: [1, 2, 3, 4],
  y: [10, 15, 13, 17],
  mode: 'scatter'
};

var layout = {
  xaxis: {
    mirror: 'ticks'
  }
};

Plotly.newPlot('myDiv', [trace1], layout);

When I run this though I just get the x-axis along the bottom. Is there more that needs to be added? If so, maybe there should be a comment about that in the multiple-axes example.

2 Likes