Skip to content

Problem with legend.position = "bottom" #7

@lukelich

Description

@lukelich

Hi,
when I try using legend.position = "bottom", as shown in your vignette, the legend keeps staying vertical at the bottom with some weird dimension (image attached).
Rplot01
I'm using ggcorrplot2_0.1.1, ggplot2_3.3.5, RColorBrewer_1.1-2.
This example shows what happens:

library(ggcorrplot2)
data(mtcars)
library(psych)
ct <- corr.test(mtcars, adjust = "none")
corr <- ct$r
ggcorrplot(corr) + 
theme( legend.position = "bottom")

I think I worked out the problem, in scale_fill_graidientn (and colour)

scale_fill_gradientn(colours = col2(200), limits = c(-1, 1),
                                guide = guide_colorbar(
                                  title = "",
                                  nbin = 1000,
                                  ticks.colour = "black",
                                  frame.colour = "black",
                                  barwidth = 1.5,
                                  barheight = 15))

barwidth and barheight are hindering any changes to the legend. Thus, when I try to flip it, it keeps barheight = 15 making that strange legend. Just removing those two lines fixed the problem.

Luca

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions