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

Add density heatmap #22

Closed
1 task done
jnumainville opened this issue May 11, 2023 · 1 comment · Fixed by #598
Closed
1 task done

Add density heatmap #22

jnumainville opened this issue May 11, 2023 · 1 comment · Fixed by #598
Assignees
Labels
enhancement New feature or request plotly-express Involves plotly-express plugin Python Involves Python side of a plugin

Comments

@jnumainville
Copy link
Collaborator

jnumainville commented May 11, 2023

Add capability to generate a density heatmap chart

This will need to be done in engine, similar to histogram. Perhaps imshow can be used as the backend, like bar is used as the histogram backend.

@jnumainville jnumainville added the enhancement New feature or request label May 11, 2023
@jnumainville jnumainville transferred this issue from deephaven/deephaven-plugin-plotly-express Sep 11, 2023
@jnumainville jnumainville added Python Involves Python side of a plugin plotly-express Involves plotly-express plugin labels Sep 11, 2023
@jnumainville
Copy link
Collaborator Author

jnumainville commented Jun 17, 2024

We would need arrays to do this in imshow, but I believe we can do this with heatmap

import plotly.graph_objects as go

fig = go.Figure(data=go.Heatmap(
                    z=[1, 20, 30, 20, 1, 6, 30, 60, 1],
                    x=[0,1,2,0,1,2,0,1,2],
                    y=[0,0,0,1,1,1,2,2,2],
))

mofojed pushed a commit that referenced this issue Jul 16, 2024
Fixes #22 
This doesn't add every argument, but does add the core ones and trivial
ones

Here is a good example of the basic ways this can be used, either with
`x`, `y`, and `histfunc="count"`, or `x`, `y`, `z`, and any `histfunc`,
as well as other arguments to control the binning as, like `histogram`,
how someone chooses to bin has a large impact on the visualization

```
import deephaven.plot.express as dx
from deephaven import new_table, agg

from deephaven import time_table

result = time_table(period="PT1S").update(["X = randomGaussian(10, 3)", "Y = randomGaussian(10, 3)", "Z = randomGaussian(10, 3)"])

density_heatmap = dx.density_heatmap(result, "X", "Y", title="Test", range_bins_x=[0, 20], range_bins_y=[0, 20], nbinsx=20, nbinsy=20)
density_heatmap_z = dx.density_heatmap(result, "X", "Y", "Z", title="Test", histfunc="std", range_bins_x=[0, 20], range_bins_y=[0, 20], nbinsx=5, nbinsy=5)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plotly-express Involves plotly-express plugin Python Involves Python side of a plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant