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

grid_size seems to do nothing #299

Open
mcsimenc opened this issue Dec 21, 2023 · 3 comments
Open

grid_size seems to do nothing #299

mcsimenc opened this issue Dec 21, 2023 · 3 comments

Comments

@mcsimenc
Copy link
Contributor

I would like to make the smallest point smaller when using node_type = "scatter". As I understood the description in the documentation, grid_size controls this, however different values for this parameter seem to have no effect.

Large value for grid_size

# Make data
mat1 = matrix(rexp(100), nrow = 10, ncol = 10)
mat2 = matrix(c(rexp(90, rate = 1), rep(0, 10)), nrow = 10, ncol = 10)

heatmaply(
  x = mat1,
  point_size_mat = mat2,
  grid_size = 1e3,
  node_type = "scatter",
  plot_method = "ggplot"
)
image

Small value for grid_size

heatmaply(
  x = mat1,
  point_size_mat = mat2,
  grid_size = 1e-3,
  node_type = "scatter",
  plot_method = "ggplot"
)
image

Any ideas what I might be doing wrong or is going on?

@mcsimenc mcsimenc added the bug label Dec 21, 2023
@alanocallaghan
Copy link
Collaborator

Only when using a fixed point size, and not when mapping point size to point_size_mat

@mcsimenc
Copy link
Contributor Author

Got it, thank you.

My use case is in emulating a plot made with ggplot mapping point size like geom_point(mapping = aes(size = ..., but the mapping function seems like it may be different than for heatmaply.

For example, here are four plots using the same data with different point size mappings:

heatmaply(plot_method = "ggplot" ...:

image

heatmaply(plot_method = "plotly" ...:

image

ggplot + geom_point(aes(size = ...:

image

ggplot + geom_point(aes(size = ... + ggplotly

image

I would like to use plot_method = ggplot, but the difference in size mapping is greatest between ggplot + geom_point(aes(size = ... and heatmaply(plot_method = "ggplot" ....

Do you know if there are any tweaks that can be made to approach it using heatmaply?

@alanocallaghan
Copy link
Collaborator

Truthfully no, as far as I can tell the call to ggplot2 should basically be equivalent to ggplot(data) + geom_point([...], size=size_var).

If you post reproducible code for the example plots you showed in the last comment, I'll have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants