question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Axis auto-range improvements

See original GitHub issue

This issue attempts to combine ideas from several individual feature requests into coherent picture (i.e. the least number of new attribute possible).

In a private conversation with @alexcjohnson , we proposed adding two new (cartesian) axis attributes: bounds and boundmode. bounds would expect 2-item array values similar to the current range. bounds can be thought of as representing the maximum possible extend of the axis ranges. In turn, boundmode would determine if bounds applies during the auto-range routine (i.e. on first view - discuss in https://github.com/plotly/plotly.js/pull/1861#issuecomment-314518657) or during interactions as well (as proposed in https://github.com/plotly/plotly.js/issues/887). For example,

xaxis: {
  autorange: true,
  boundmode: 'soft',
  bounds: [0, 100]
}

would restrict the auto-range logic to compute an x-axis range between 0 and 100. This might be useful when plotting percentages where users don’t want the axis ranges to go beyond 100%.

xaxis: {
  boundmode: 'hard',
  bounds: [0, 100]
}

would restrict the axis range to [0,100] in the auto-range logic and during interactions.

In doing so, 1-way bounds values such as [null, 100] or [0, null] should be allowed. null items here mean don’t restrict the min (or max) bound acting. This behavior is similar to cmin and cmax for color scales. This call signature should also be extended to the axis range attribute - taking care of https://github.com/plotly/plotly.js/issues/400


A few more things to think about:

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:43
  • Comments:46 (18 by maintainers)

github_iconTop GitHub Comments

32reactions
grandsmarquiscommented, Aug 10, 2018

Any news for this? The yaxis.autorange: ‘visible’ is really needed across the forums and is making lot of people moving to other libs.

27reactions
alexcjohnsoncommented, Jul 12, 2017

One other idea we’ve discussed is autoranging one axis based on only the data that’s visible on the opposite axis or axes - for example zoom in on a particular x range and autorange y based only on the x data in that range. Perhaps autorange: 'visible'?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Y-axis auto-ranging auto-scaling based on the values of that ...
I believe this is a long-requested feature and I think this is the overarching bug: Axis auto-range improvements · Issue #1876 ...
Read more >
Python Plotly: How to set the range of the y axis?
In this article, we will learn how to set the range of the y-axis of a graph using plotly in Python. To install...
Read more >
X-Axis - Telerik UI for WPF - Documentation
However, the chart above could be improved if a bit more ticks are shown. When AutoRange is True, then you can control the...
Read more >
QtCharts auto range for y-axis - c++ - Stack Overflow
We can use the signal pointAdded of the series to update the range, for this we will create 2 variables that store the...
Read more >
Silverlight/WPF RadChart axis improvements. | Facebook
Of course, this behavior can be switched off with setting the AutoRange property to false. In this case, the MinValue, MaxValue and Step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found