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.

feature request: scale extents a bit more than the absolute fit

See original GitHub issue

Right now:

hv.Scatter([[-1,-1], [-1, 1], [0, 1], [1,1]])

gives points that you cannot even see: download

Preferably the plot would take the extent and make it 10% bigger or so, like:

hv.Scatter([[-1,-1], [-1, 1], [0, 1], [1,1]])[-1.1:1.1, -1.1:1.1]

which does show the points: download 1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:20 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
philippjfrcommented, Jul 25, 2019

I assume the diff will be to set this value to 0.05

Not sure, I usually use 0.1 for 5% padding on each end.

2reactions
philippjfrcommented, Jan 30, 2017

Agreed, this is something we should have added a long time ago. All our plots should automatically pad the axis ranges by a few percent. The question has always been how precisely the padding is calculated. Is it a fixed 10% or is there special handling around zero? Other plotting libraries have had this discussion (see https://github.com/matplotlib/matplotlib/issues/4891) and have generally settled on a fixed 4-5% padding along each axis:

The easiest way to handle this is to simply ensure that the axis limits are slightly larger than necessary to cover all the data, and then leave it at that. It avoids the really nasty cases, avoids surprises, and if people want something fancier than they almost always have to tweak the limits by hand anyway. As further evidence that this works, this is what R does and it basically just works – no-one complains.

Specifically, base R calculates default axis limits by: taking the min and max of the data, and then setting the limits 4% further beyond each of those. ggplot2 uses a similar algorithm, but uses 5% by default. (See here, semantics of expand= is (multiplicative expansion, additive expansion).)

If we agree with both matplotlib and ggplot2 (and bokeh?) that’s what we can use by default as well. It’s trivial to do and I strongly believe this belongs in 1.7 as part of changing our global styling defaults (https://github.com/ioam/holoviews/issues/823).

Read more comments on GitHub >

github_iconTop Results From Across the Web

feature request: scale extents a bit more than the absolute fit ...
The question has always been how precisely the padding is calculated. Is it a fixed 10% or is there special handling around zero?...
Read more >
Feature Requests: What are they and how to manage them
Feature requests are a form of product feedback you may frequently encounter as a SaaS product manager. They typically come in the form...
Read more >
4. Regression and Prediction - Practical Statistics for Data ...
The t-statistic—and its mirror image, the p-value—measures the extent to which a coefficient is “statistically significant”—that is, outside the range of what ...
Read more >
Size Limits of PCB workspace | Altium Designer
From there the workspace extends to the top and to the right, but you cannot reach any points below absolute zero. It would...
Read more >
Feature Requests - Audacity Wiki
Length of audio should be the minimum interval possible taking the settings of the Fourier transform used in each track, namely the FFT...
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