Skip to content

Remove or suppress legends from dotplot class panels #688

Open

Description

@lee-t

Right now the dotplot class has an option that accepts only 2 options ( "Bottom","Right") for LegendPosition. We have a case in one of our apps that the resulting ReducedDimPlot has over 50 discrete labels; this makes the legend take up too much of the space. We would like to be able to use LegendPosition = none which ggplot will simply not create the legend.

Activity

  1. federicomarini commented on Feb 26, 2025

    @federicomarini
    Contributor

    This might simply boil down to adding a valid option to the current Bottom and Right.
    Since the way we handle the legend placement is simply via the theme() command, that should be easy to insert.

    For a reference, see

    iSEE/R/plotting.R

    Lines 258 to 266 in 2d462c8

    plot_cmds[["theme_custom"]] <- sprintf(
    "theme(legend.position='%s', legend.box='vertical', legend.text=element_text(size=%s), legend.title=element_text(size=%s),
    axis.text=element_text(size=%s), axis.title=element_text(size=%s), title=element_text(size=%s))",
    tolower(slot(param_choices, .plotLegendPosition)),
    font_size * .plotFontSizeLegendTextDefault,
    font_size * .plotFontSizeLegendTitleDefault,
    font_size * .plotFontSizeAxisTextDefault,
    font_size * .plotFontSizeAxisTitleDefault,
    font_size * .plotFontSizeTitleDefault)

    --> having our code create theme(legend.position="none") should do it

  2. federicomarini commented on Feb 26, 2025

    @federicomarini
    Contributor

    Is undergoing some work in #689

  3. federicomarini commented on Feb 26, 2025

    @federicomarini
    Contributor

    Huch, this is not going to be fun

    Image

    (probably due to the upcoming R devel changes...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions