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.

Using datashade=True flips the image up-down

See original GitHub issue

Description of expected behavior and the observed behavior

Using datashade=True option the plotted image is flipped up-down. Is there some bug due to datashade or I am doing something wrong. I also see the dynamic range of color changed as well.

See the two images below side-by-side, with only change being ‘datashade=True’

Here dem is any 1-band DEM

Complete, minimal, self-contained example code that reproduces the issue

dem = dems[0] 
ds =rioxarray.open_rasterio(f'{base_folder}/{dem}')
print(f'DEM: {dem}')
print(ds.shape)

asp = ds.shape[-1]/ds.shape[1]

ds.hvplot.image(x='x', y='y', aspect=asp, frame_width=250, cmap='gist_earth') + ds.hvplot.image(datashade=True, x='x', y='y', aspect=asp, frame_width=250, cmap='gist_earth')

Screenshots or screencasts of the bug in action

hvplot_flip_datashade

ALL software version info

all these libraies from conda-forge hvplot: 0.7.0
datashader 0.12.0
holoviews 1.14.1
xarray 0.16.2
rioxarray 0.1.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jbednarcommented, Apr 11, 2021

We’ve definitely run into flipping issues in various cases before, but not this particular one; the files we test with must all have ascending coordinates. It would be great to have a check to catch this condition and do the flipping if needed.

0reactions
jbednarcommented, Jun 23, 2022

Fixed in #1095.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using datashade=True flips the image up-down #1054 - GitHub
It will flip the data AND the appropriate coordinate accordingly so that datashader has no problem. The default plotter plots ascending y in...
Read more >
Flip an Image - CSS-Tricks
You can flip images with CSS! Possible scenario: having only one graphic for an “arrow”, but flipping it around to point in different...
Read more >
Your Eyes See Upside Down and Reversed
Your eyes mimic a pinhole camera where all images falling on the retina become upside down and reversed. Binocular vision adds our ability ......
Read more >
Flipping Images Horizontally Or Vertically With CSS And ...
We'll explore how to flip an img element, a background-image , or flip the actual ImageData using a canvas element. Flipping an Image...
Read more >
Right Side Up - Scientific American
Although people often believe that an upside-down image in the eyeball gets rotated somewhere in the brain to make it look right side...
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