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.

Better default bounds for Image

See original GitHub issue

Currently, the default behavior for Image is to apply bounds of ±0.5 to both axes. If the original data is not square shaped, the result is a distorted image, as shown below:

%%opts Image (cmap="gray") [aspect='equal']
import holoviews as hv
from scipy import misc
face = misc.face(gray=True)
hv.Image(face)

image

The original image was 1024x768, but is now shown squashed. When no bounds are specified, the bounds should be set so that the data’s original aspect ratio is preserved, e.g. something like this:

  1. Set bounds on x axis to -0.5 and +0.5
  2. Set bounds on y axis to -a and +a, where a=data.shape[1]/data.shape[0]*0.5

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
drs251commented, Jun 14, 2017

Or it might be nice to replicate the behaviour of Raster as the default setting, to make it easier to switch between the two. Anyway, as long as the aspect of the original data is preserved, I’d be happy.

1reaction
michaelayecommented, Sep 1, 2017

Do I understand that you propose to not have any class that flips an image array with (0,0) in the top left? I would bet that all image/remote sensing ppl are rather more familiar with that layout, and in fact most space imagery defaults to this. So I vote for having at least one class doing this by default, just as plt.imshow does.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how do I get the bounds of a static google map? - Stack Overflow
I am trying to plot geo coordinates (lat/lon) on an image I retrieve via Googles static Map API. I want to do this...
Read more >
Fitting images into available space - Apple Developer
By default, this modifier scales the image by reducing the size of larger images and enlarges images smaller than the view. By itself,...
Read more >
Filtering imageCollection to get only images that fully cover a ...
I would like to perform a supervised classification only on the images of the collection that cover the entire geometry Domain. I used...
Read more >
Restricting Map Bounds | Maps JavaScript API
This example creates a map that starts in Auckland, New Zealand. The map is restricted to New Zealand. The user can pan away...
Read more >
How to resize a SwiftUI Image and keep its aspect ratio - Sarunw
Learn how to use aspect fit and aspect fill content mode to fit your image to its bounds.
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