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

create.heatmap: yaxis.lab does not work for 1x1 input #151

Open
jarbet opened this issue Sep 7, 2023 · 1 comment
Open

create.heatmap: yaxis.lab does not work for 1x1 input #151

jarbet opened this issue Sep 7, 2023 · 1 comment

Comments

@jarbet
Copy link
Contributor

jarbet commented Sep 7, 2023

yaxis.lab does not work for 1x1 input:

suppressPackageStartupMessages(library(BoutrosLab.plotting.general));
cov.data <- data.frame('lightgrey');

create.heatmap(
    x = cov.data,
    clustering.method = 'none',
    input.colours = TRUE,
    print.colour.key = FALSE,
    same.as.matrix = TRUE,
    yaxis.lab = 'A',
    );

yaxis.lab works for larger inputs:

suppressPackageStartupMessages(library(BoutrosLab.plotting.general));
cov.data <- data.frame(rep('lightgrey', 2));

create.heatmap(
    x = cov.data,
    clustering.method = 'none',
    input.colours = TRUE,
    print.colour.key = FALSE,
    same.as.matrix = TRUE,
    yaxis.lab = c('A', 'B'),
    );

Created on 2023-09-07 by the reprex package (v2.0.1)

@jarbet
Copy link
Contributor Author

jarbet commented Sep 7, 2023

Temporary fix:

  • Don't use same.as.matrix
  • Notice yaxis.lab uses empty values '' to get the label to appear where you want
suppressPackageStartupMessages(library(BoutrosLab.plotting.general));
cov.data <- data.frame('lightgrey');

create.heatmap(
    x = cov.data,
    clustering.method = 'none',
    input.colours = TRUE,
    print.colour.key = FALSE,
    #same.as.matrix = TRUE,
    yaxis.lab = c('','', '', 'A', '', ''),
    );

Created on 2023-09-07 by the reprex package (v2.0.1)

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