Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

df.hvplot.heatmap: Problem specifying value dimensions #188

Closed
Sieboldianus opened this issue Mar 19, 2019 · 0 comments · Fixed by #255
Closed

df.hvplot.heatmap: Problem specifying value dimensions #188

Sieboldianus opened this issue Mar 19, 2019 · 0 comments · Fixed by #255
Labels
type: enhancement New feature or request
Milestone

Comments

@Sieboldianus
Copy link

Sieboldianus commented Mar 19, 2019

This was originally asked on here but I'll report it here as a feature request by the request of philippjfr

I have problems specifying value dimensions for an existing simple dataframe when plotting a heatmap. I can do something pretty similar with:

df.style.background_gradient(cmap='summer')
https://i.stack.imgur.com/gcLOt.png

The dataframe is pretty simple:

> df.index
Index(['ackerland', 'friedhof', 'gartenland', 'gehoelz', 'golfplatz',
       'gruenland', 'heide', 'kleingarten', 'laubholz', 'mischholz', 'moor',
       'nadelholz'],
      dtype='object')
> df.columns
Index(['hiking', 'biking', 'walking', 'sport', 'friends', 'family', 'picnic'], dtype='object')

According to the docs on heatmap it should be directly possible to plot this using df.hvplot.heatmap. But when I do:

>import hvplot.pandas
>df.hvplot.heatmap(colorbar=True)
ValueError: Dimensions must be defined as a tuple, string, dictionary or Dimension instance, found a NoneType type.

This does also not work:

>df.hvplot.heatmap(x=df.index, y=df.columns, colorbar=True)
ValueError: The truth value of a Index is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

I got it to work with Holoviews API:
hv.HeatMap({'x': df.columns, 'y': df.index, 'z': df}, ['x', 'y'], 'z'),
but the same syntax does not work in hvplot:

>df.hvplot.heatmap({'x': df.columns, 'y':df.index, 'z': df}, ['x', 'y'], 'z')
ValueError: Dimensions must be defined as a tuple, string, dictionary or Dimension instance, found a list type.
@philippjfr philippjfr added the type: enhancement New feature or request label Jul 17, 2019
@philippjfr philippjfr added this to the v0.5.0 milestone Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants