Better default bounds for Image
See original GitHub issueCurrently, 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)
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:
- Set bounds on x axis to -0.5 and +0.5
- Set bounds on y axis to -a and +a, where a=data.shape[1]/data.shape[0]*0.5
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:9 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.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.