Black Lives Matter. Please consider donating to Black Girls Code today.

How do I inverse data elements in data array? (Inversion of one the data elements in data array)

How do I inverse data elements in data array? I need to plot Read vs Writes data.So I need read data to be plotted in positives and write data in negatives.Is there any provision to do this. There is one provision for reversing entire axis but I want only one data element from the array to plotted opposite. Thanks.

You can try using autorange: 'reversed' and setting a decreasing axis range (e.g. range: [3, 1])

See https://codepen.io/etpinard/pen/BZNLQe?editors=0010

what if I want to plot two data sets in one graph and I want one of them to be inversed?

Then, you’ll need to reverse the data arrays before feeding them to Plotly.plot I’m afraid.

okay.I did the same but, just wanted to know if there’s any other way.

Thanks :slight_smile: