holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.08k stars 105 forks source link

Contourf/quadmesh seem to be flipping the y axis #123

Closed jsignell closed 5 years ago

jsignell commented 5 years ago

Expected

Image has the right axis direction

screen shot 2018-12-06 at 3 05 42 pm

Actual

quadmesh and contourf do not have the right y axis direction. You can see this because the lake is upside down relative to the lake in the tile imagery.

Quadmesh

screen shot 2018-12-06 at 3 05 23 pm

Contourf

screen shot 2018-12-06 at 3 07 48 pm

Versions

gv: '1.6.0a3.post4+g6fa50ac' hvplot: '0.3.0a7+gd41cce0-dirty'

>>> unstacked
<xarray.DataArray (x: 300, y: 300)>
array([[3, 3, 0, ..., 0, 0, 2],
       [3, 3, 3, ..., 0, 0, 0],
       [3, 3, 0, ..., 0, 0, 0],
       ...,
       [0, 0, 0, ..., 0, 3, 2],
       [3, 3, 3, ..., 3, 3, 2],
       [3, 3, 3, ..., 3, 3, 0]], dtype=int32)
Coordinates:
    band     int64 1
  * x        (x) float64 3.324e+05 3.326e+05 3.327e+05 ... 3.771e+05 3.772e+05
  * y        (y) float64 4.309e+06 4.309e+06 4.309e+06 ... 4.264e+06 4.264e+06
Attributes:
    transform:   (150.0, 0.0, 332325.0, 0.0, -150.0, 4309275.0)
    crs:         +init=epsg:32611
    res:         (150.0, 150.0)
    is_tiled:    0
    nodatavals:  (nan,)
ahuang11 commented 5 years ago

I wonder if related to: https://github.com/pyviz/hvplot/issues/23

philippjfr commented 5 years ago

@jsignell Is there somewhere I can fetch the dataset?

jsignell commented 5 years ago

Here it is: unstacked.tiff.zip

Just unzip and then unstacked = xr.open_rasterio('unstacked.tiff')

philippjfr commented 5 years ago

I can reproduce the flip in the contour but not in the quadmesh

screen shot 2018-12-07 at 1 30 13 am

screen shot 2018-12-07 at 1 31 31 am

philippjfr commented 5 years ago

I think the remaining issue is addressed in my recent commit here: https://github.com/pyviz/geoviews/pull/260/files

philippjfr commented 5 years ago

Fixed in latest geoviews release.