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

How to add axis labels? #16

Open
vertesy opened this issue Mar 12, 2024 · 0 comments
Open

How to add axis labels? #16

vertesy opened this issue Mar 12, 2024 · 0 comments

Comments

@vertesy
Copy link

vertesy commented Mar 12, 2024

Related to #15, this is a feature request.

I would like to add axis label, in addition to column labels, as possible with heatmaply:
This is a gllobal X and Y label as in usual plots.

image

I tried

  • labs()
  • ggtitle
  • annotate()
  • geom_text()

e.g:

>   ggheatmap::ggheatmap(data_matrix ) + labs(title = 'title', subtitle = 'subtitle', caption = 'caption')
# plot is generated, and labeled correctly

>   ggheatmap::ggheatmap(data_matrix ) + labs(title = 'title', subtitle = 'subtitle', caption = 'caption', x ="111", y ="1212121")
# no x y labels added 

Otherwise labs() works

 p <- ggplot(mtcars, aes(mpg, wt, colour = cyl)) + geom_point()
 p + labs(x = "New x label")

Also nothing (may have mistakes):

 p + 
  geom_text(label="Custom X Label", x=5, y=0, hjust=1, vjust=1, size=5) +
  geom_text(label="Custom Y Label", x=0, y=35, angle=90, hjust=1, vjust=1, size=5)

Same for other trials

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

1 participant