uclahs-cds / package-BoutrosLab-plotting-general

Functions to Create Publication-Quality Plots
https://uclahs-cds.github.io/package-BoutrosLab-plotting-general
12 stars 4 forks source link

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

Open jarbet opened 1 year ago

jarbet commented 1 year ago

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 commented 1 year ago

Temporary fix:

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)