mikata-project / ggthemr Goto Github PK
View Code? Open in Web Editor NEWThemes for ggplot2.
Themes for ggplot2.
Hi,
Thank you for a brilliant package! Have used it for my plots but there is one that it isn't compatible with, so I'm adjusting a few things so that graph isn't the odd one out. I found info about the colours for my chosen theme ("flat") in your documents, but I can't find what the text font is, is this something you can tell me?
Thanks!
Hi,
I would like to use some of the themes from ggthemr
for a package that I plan to release on BioConductor, but of course, I cannot have dependency for packages available only on github.
The latest commits on master and dev branches are dated from last September. So I was wondering whether you already have plans for submission to CRAN?
Best.
Thanks for publishing this! I think it would be better findable, if displayed on GitHub.com/topics/ggplot2-themes, please consider adding that topic to this repo. Thank you :-)
Hi, first of all congrats for the amazing package and themes !
Following the examples I achieve to change the theme of a ggplot2 object following your instructions in the last part
dust_theme <- ggthemr(palette = "dust", set_theme = FALSE)
example_plot + dust_theme$theme
example_plot + dust_theme$theme + dust_theme$scales$scale_fill_discrete()
warning: attempt to apply non-function
The colors doesn't change, and there's nothing in the object dust_theme referred to scales
dust_theme$scales = NULL
dust_themes$scales$scale_fill_discrete
Any idea about why the colors don't change??.
I achieve to change colors if I type, but they are not so well adapted to the background
example_plot + dust_theme$theme +scale_fill_manual(values = dust_theme$palette$swatch)
Thanks for your time and help!
I prefer to use ggplot2::theme_minimal()
, but I need to have different colors. This is the only change I want to make. Is there some way to do this with ggthemr? When I use layout = "minimal"
it still changes a number of other things about the ggplot theme.
the ggthemr can not be installed in R-3.5.1,can you update it?
I'm trying to create a custom theme that can be used with ggthemr
. Is it possible to set transparent colours - in particular for the background. I tried somthing along the following lines, but transparent
is not a known R colour.
mytheme <- define_palette(swatch = c('black', 'red', 'green', 'blue', 'brown', 'purple', 'yellow'), gradient = c(lower = 'red', upper = 'green'),
background = "transparent",
text = c("#444444", "#444444"),
line = c("#6e6e6e", "#6e6e6e"),
gridline = "#c3c3c3")
In ggplot
it is possible to set the background using, say, something along the following lines
opts(
panel.background = theme_rect(fill = "transparent",colour = NA), # or theme_blank()
plot.background = theme_rect(fill = "transparent",colour = NA)
)
Thanks for a wonderful package!
Hi got this problem: several function is not available for ggthemr namespace
`> get_themr()
Error: could not find function "get_themr"
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2 ReporteRs_0.8.8 ReporteRsjars_0.0.2 tidyr_0.6.3 stringr_1.2.0
[6] readxl_1.0.0 dplyr_0.7.1 data.table_1.10.4 ggthemr_1.1.0 ggplot2_2.2.1.9000
loaded via a namespace (and not attached):
[1] zip_1.0.0 Rcpp_0.12.12 cellranger_1.1.0 git2r_0.18.0 plyr_1.8.4 bindr_0.1
[7] base64enc_0.1-3 R.methodsS3_1.7.1 R.utils_2.5.0 tools_3.3.2 uuid_0.1-2 digest_0.6.12
[13] memoise_1.1.0 tibble_1.3.3 gtable_0.2.0 png_0.1-7 pkgconfig_2.0.1 rlang_0.1.1
[19] shiny_1.0.3 curl_2.7 rJava_0.9-8 xml2_1.1.1 officer_0.1.4 withr_1.0.2
[25] httr_1.2.1 knitr_1.16 gdtools_0.1.4 devtools_1.13.2 grid_3.3.2 glue_1.1.1
[31] R6_2.2.2 rvg_0.1.4 purrr_0.2.2.2 magrittr_1.5 htmltools_0.3.6 scales_0.4.1.9002
[37] assertthat_0.2.0 xtable_1.8-2 mime_0.5 colorspace_1.3-2 httpuv_1.3.5 stringi_1.1.5
[43] lazyeval_0.2.0 munsell_0.4.3 R.oo_1.21.0 `
Hello,
I a using your package to define my own theme and palette and I ecnountered what seems to be an issue. The legend for continuous gradient is set as it was discrete.
Here is an example code.
library('ggthemr')
ggthemr('dust')
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Sepal.Length)) +
geom_point(size = 4, alpha = .6)
Thank you for your work,
Mathieu
Hello
Thanks for creating so nice package!
When I use this package, I find a problem. Here is my code:
`
ggthemr("light")
ggplot(cars, aes(x = speed, y = dist)) + geom_point()
ggthemr_reset()
ggplot(cars, aes(x = speed, y = dist)) + geom_point()
`
When I reset the theme, The background is changed to the default theme, however the point is still green which I assume the point should be changed back to black.
Thanks!
The recent changes in ggplot2
(it updated to 2.0.0 today) have seemingly broken ggthemr in a fundamental fashion.
for instance:
library(ggthemr)
ggthemr("flat")
results in the error message
Error: No geom called GeomJitter.
In addition: Warning messages:
1: `axis.ticks.margin` is deprecated. Please set `margin` property of `axis.text` instead
2: New theme missing the following elements: panel.ontop, strip.switch.pad.grid, strip.switch.pad.wrap
and making a simple plot
ggplot(diamonds, aes(x = x, y = y)) +
geom_point()
fails with this error message:
Error in if (theme$panel.ontop) { : argument is of length zero
Just thought you should be apprised, since the new ggplot2
is on Cran now.
My sessionInfo()
:
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] ggthemr_1.0.1 ggplot2_2.0.0
loaded via a namespace (and not attached):
[1] labeling_0.3 colorspace_1.2-6 scales_0.3.0
[4] plyr_1.8.3 tools_3.2.3 gtable_0.1.2
[7] Rcpp_0.12.2 grid_3.2.3 munsell_0.4.2
Hi,
I love the visuals you've created here, fresh and modern. So much so that in a theming library for a completely different language, julia, I've used the colors and looks of this package (with attribution in the readme). The package is https://github.com/mkborregaard/MakieThemes.jl , it aims to provide a wide suite of popular themes for the new julia plotting package Makie.jl, and I'd like to make a ggthemr submodule for your visuals here.
The question is, are you OK with me doing that and releasing that package under the MIT license? The MIT is a more open and permissive license than GPL-3. The reason I ask is that under the GPL-3 license terms, if just one theme I use is GPL-3, my whole package needs to be GPL-3, and in turn any downstream user's project using MakieThemes would in principle also need to be GPL-3 even if they don't use any of these themes. I.e. the GPL-3 pervades all other licenses. This is not a problem in the R ecosystem, which is essentially all GPL, but e.g. in Julia most packages are on open licenses and very few packages are GPL (for this reason), so a GPL license will lead to considerably less uptake of the functionality.
I should note that we're in the borderline of open source licensing here, as I don't port any of your source code at all! The thing I'm copying is things like colors, linewidths, gridline styles and the layout of your example - things that are all available from final plots and do not require looking at your open source code. But I still feel that it is most ethical to ask your position on this given that it is clearly your intellectual property, and I will respect the decision you make here.
Thanks.
The old problem did not appear, but the new problem appeared.
library(tibble)
library(dplyr)
library(ggplot2)
tb <- tibble(
x = letters[1:9],
y = 1:9
)
tb %>%
ggplot(aes(x, y, color = x)) +
geom_point()
but,after load ggthemr
library(ggthemr)
ggthemr("dust")
ggthemr_reset()
# does not work
tb %>%
ggplot(aes(x, y, color = x)) +
geom_point()
# Error: Your data requires 9 colours but the swatch provided by ggthemr only has 8. To resolve this you can provide an appropriate
# vector of colours to your scale or expand the swatch using set_swatch(). Note: if you are using a custom palette, the first swatch colour
# is separate from the others. See the documentation for define_palette() and/or set_swatch()
still does not work
pacman::p_unload("ggthemr")
tb %>%
ggplot(aes(x, y, color = x)) +
geom_point()
# Error: Your data requires 9 colours but the swatch provided by ggthemr only has 8. To resolve this you can provide an appropriate
# vector of colours to your scale or expand the swatch using set_swatch(). Note: if you are using a custom palette, the first swatch colour
# is separate from the others. See the documentation for define_palette() and/or set_swatch()
ggplot2 just updated 6 days ago to 3.1.1. Loading a ggthemr theme now throws the following message:
Warning message:
New theme missing the following elements: axis.ticks.length.x, axis.ticks.length.x.top, axis.ticks.length.x.bottom, axis.ticks.length.y, axis.ticks.length.y.left, axis.ticks.length.y.right
Calling ggplot now results in the following error:
Error in axis.ticks.length.x.bottom %||% axis.ticks.length.x :
object 'axis.ticks.length.x.bottom' not found
Any chance these elements can be specified in the themes or is there a workaround? Thank you!
with geom_col the fill color of the bars is not set to default palette color while with geom_bar it is.
ggthemr('flat')
ggplot(mtcars, aes(x = mpg, y = cyl)) +
geom_col()
ggplot(mtcars, aes(x = mpg, y = cyl)) +
geom_bar(stat = 'identity')
library(ggthemr)
#> Loading required package: ggplot2
library(tidyverse)
#> Warning: package 'tidyr' was built under R version 4.1.2
#> Warning: package 'readr' was built under R version 4.1.2
#> Warning: package 'dplyr' was built under R version 4.1.2
set.seed(12345)
random_colours <- sample(colors()[-c(1, 253, 361)], 10L)
ugly <- define_palette(
swatch = random_colours,
gradient = c(lower = random_colours[1L], upper = random_colours[2L])
)
ggthemr(ugly)
mtcars %>%
ggplot(aes(x = disp,
y = mpg,
col = as.factor(gear))
) +
geom_point()
Created on 2022-04-11 by the reprex package (v2.0.1)
Hi! Could you please let me know how to properly credit this package? I am using it for a publication but cannot find the citation. Great package! Thank you
Hi,
I want to start by thanking you for the ggthemr
R package, it is a real gem.
I wanted to know if the dev version of ggthemr
should be compatible with the recent ggplot2
version. When are use both dev version of ggthemr
and ggplot2
, I get the following error:
devtools::install_github("hadley/ggplot2")
devtools::install_github("cttobin/ggthemr")
library(ggplot2)
library(ggthemr)
ggthemr(palette = "flat")
## Error in theme(line = element_line(colour = line_colour, size = line_weight, :
## formal argument "strip.text" matched by multiple actual arguments
Thanks again
I am trying to apply the dust theme:
df = structure(list(Subject = c("BIOL112_2019W1", "BIOL112_2019W1",
"BIOL112_2019W1", "BIOL112_2019W1", "BIOL112_2019W1", "CHEM100_2019W1",
"CHEM100_2019W1", "CHEM100_2019W1", "CHEM100_2019W1", "CHEM121_2019W1",
"CHEM121_2019W1", "CHEM121_2019W1", "CHEM121_2019W1", "CHEM121_2019W1",
"CHEM121_2019W1", "PHYS100_2019W1", "PHYS100_2019W1", "PHYS100_2019W1",
"PHYS100_2019W1", "PHYS100_2019W1", "PHYS100_2019W1"), time = c("post",
"post", "post", "pre", "pre", "post", "post", "pre", "pre", "post",
"post", "post", "pre", "pre", "pre", "post", "post", "post",
"pre", "pre", "pre"), cat = c("Anx", "Anx", "Anx", "Anx", "Anx",
"Anx", "Anx", "Anx", "Anx", "Anx", "Anx", "Anx", "Anx", "Anx",
"Anx", "Anx", "Anx", "Anx", "Anx", "Anx", "Anx"), Survey = c("Man",
"Non-binary", "Woman", "Man", "Woman", "Man", "Woman", "Man",
"Woman", "Man", "Non-binary", "Woman", "Man", "Non-binary", "Woman",
"Man", "Non-binary", "Woman", "Man", "Non-binary", "Woman"),
mean_score = c(4.20625, 2.25, 3.72207446808511, 4.11788617886179,
3.65895061728395, 4.4375, 4.18103448275862, 4.015625, 3.56451612903226,
3.98477157360406, 3.0625, 3.3278463648834, 4.00177935943061,
4.9, 3.51446280991736, 3.79565217391304, 3.5, 3.31778425655977,
3.96319018404908, 2.85, 3.42198581560284), lower_ci = c(4.00610708103331,
-0.762136813856149, 3.59206496072721, 3.96528754103603, 3.57060924917053,
3.9625603470315, 3.78725656642336, 3.64998728369789, 3.25023542431441,
3.85339501830383, 2.37543805832114, 3.23925134175537, 3.8973161573749,
4.14230033953502, 3.43691199959787, 3.63130241468709, 2.4521878436764,
3.22338855877664, 3.82418287816304, 1.86272252808857, 3.34043187520304
), upper_ci = c(4.40639291896669, 5.26213681385615, 3.852083975443,
4.27048481668755, 3.74729198539737, 4.9124396529685, 4.57481239909388,
4.38126271630211, 3.87879683375011, 4.11614812890429, 3.74956194167886,
3.41644138801143, 4.10624256148631, 5.65769966046498, 3.59201362023684,
3.96000193313899, 4.5478121563236, 3.41217995434289, 4.10219748993512,
3.83727747191143, 3.50353975600263)), row.names = c(NA, -21L
), groups = structure(list(Subject = c("BIOL112_2019W1", "BIOL112_2019W1",
"CHEM100_2019W1", "CHEM100_2019W1", "CHEM121_2019W1", "CHEM121_2019W1",
"PHYS100_2019W1", "PHYS100_2019W1"), time = c("post", "pre",
"post", "pre", "post", "pre", "post", "pre"), cat = c("Anx",
"Anx", "Anx", "Anx", "Anx", "Anx", "Anx", "Anx"), .rows = structure(list(
1:3, 4:5, 6:7, 8:9, 10:12, 13:15, 16:18, 19:21), ptype = integer(0), class = c("vctrs_list_of",
"vctrs_vctr", "list"))), row.names = c(NA, -8L), class = c("tbl_df",
"tbl", "data.frame"), .drop = TRUE), class = c("grouped_df",
"tbl_df", "tbl", "data.frame"))
plt<- ggplot(data= df, aes(x = mean_score, y = Survey, xmin = lower_ci, xmax = upper_ci, color= time))+
geom_errorbar(position = position_dodge(0.3), width = 0.3) +
geom_point( position = position_dodge(0.3), size = 2.5)+
facet_grid(Subject~cat)+
theme(legend.position="top",
text = element_text(size=18))
ggthemr("dust")
plt
but I get an error Error: Unknown colour name: post
I understand that somehow it is not able to apply the color theme to the column that is used for plotting. I am not sure how to specify it
Installing the package fails and exits with an error:
devtools::install_github('ggthemr', 'cttobin')
Installing github repo ggthemr/master from cttobin
Downloading master.zip from https://github.com/cttobin/ggthemr/archive/master.zip
Installing package from C:\Users\Luedeke\AppData\Local\Temp\Rtmpygkd1x/master.zip
Installing ggthemr
"C:/PROGRA2/R/R-311.1/bin/i386/R" --vanilla CMD INSTALL
"C:\Users\Luedeke\AppData\Local\Temp\Rtmpygkd1x\devtools7cc4f426412\ggthemr-master"
--library="C:/Users/Luedeke/Documents/R/win-library/3.1" --install-tests
I'm using R 3.1.1 on Win 7, latest RStudio and devtools-package.
sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sjPlot_1.4.4
loaded via a namespace (and not attached):
[1] car_2.0-21 cluster_1.15.2 coin_1.0-23 colorspace_1.2-4
[5] devtools_1.5 digest_0.6.4 evaluate_0.5.5 foreign_0.8-61
[9] ggplot2_1.0.0 grid_3.1.1 gtable_0.1.2 httr_0.4
[13] lattice_0.20-29 lmtest_0.9-33 lsmeans_2.11 MASS_7.3-33
[17] Matrix_1.1-4 memoise_0.2.1 modeltools_0.2-21 multcomp_1.3-6
[21] munsell_0.4.2 mvtnorm_1.0-0 nnet_7.3-8 parallel_3.1.1
[25] plyr_1.8.1 proto_0.3-10 psych_1.4.8.11 Rcpp_0.11.2
[29] RCurl_1.95-4.3 reshape2_1.4 sandwich_2.3-1 scales_0.2.4
[33] splines_3.1.1 stats4_3.1.1 stringr_0.6.2 survival_2.37-7
[37] TH.data_1.0-3 tools_3.1.1 whisker_0.3-2 zoo_1.7-11
Thanks for your package, I found a bug when I am using ggthemr_reset() function. It can not return back to the default theme of ggplot2. Can you help? Here is my code:
library(ggplot2)
library(ggthemr)
ggthemr("light")
ggplot(mtcars) + geom_point(aes(x = cyl, y = mpg))
ggthemr_reset()
ggplot(mtcars) + geom_point(aes(x = cyl, y = mpg))
Is there a simple way to reset all settings to default? e.g.,
p <- ggplot() + # ...
ggthemr("hoge")
p
# reset settings
ggthemr_reset()
p # generates default style ggplot2 figure.
I am trying to plot a bar plot with 16 bins. I am getting an error
Error: Your data requires 16 colours but the swatch provided by ggthemr only has 8. To resolve this you can provide an appropriate vector of colours to your scale or expand the swatch using set_swatch(). Note: if you are using a custom palette, the first swatch colour is separate from the others. See the documentation for define_palette() and/or set_swatch()
This is my code below
ggthemr('fresh', layout = 'scientific', spacing = 2, type = 'inner')
ggplot(data=c1, aes(x=Var1, y=Freq, fill=Var1)) +
geom_bar(stat="identity",fill = pal) +
ylab("Count") +
ggtitle("Cryo") +
theme(axis.text.x=element_text(angle=45,hjust=1,vjust=0.5))+
geom_text(aes(y=Freq, label = Freq), vjust=1.6, color="black", size=3.5)
This is my dataset
c1 <- structure(list(Var1 = structure(1:16, .Label = c("(-Inf,0]",
"(0,100]", "(100,200]", "(200,300]", "(300,400]", "(400,500]",
"(500,600]", "(600,700]", "(700,800]", "(800,900]", "(900,1e+03]",
"(1e+03,1.1e+03]", "(1.1e+03,1.2e+03]", "(1.2e+03,1.3e+03]",
"(1.3e+03,1.4e+03]", "(1.4e+03, Inf]"), class = "factor"), Freq = c(1652L,
3L, 20L, 25L, 6L, 6L, 2L, 3L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L)), .Names = c("Var1",
"Freq"), row.names = c(NA, -16L), class = "data.frame")
Thank you for your work providing a powerful tool.
However,when I use this package ,a error as followed always occured.
ggthemr('fresh')
Error in (function (el, elname) :
"axis.text.x.top" is not a valid theme element name.
So,can you tell me how to solve it
Thank you!
Similar to #29 , I am unable to install the package.
The problem remains regardless of which options (here: "3") I choose during the process.
`> devtools::install_github('cttobin/ggthemr')
WARNING: Rtools is required to build R packages, but is not currently installed.
Please download and install Rtools custom from http://cran.r-project.org/bin/windows/Rtools/.
Downloading GitHub repo cttobin/ggthemr@master
These packages have more recent versions available.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: rlang (0.4.3 -> 0.4.4) [CRAN]
5: stringi (1.4.4 -> 1.4.5) [CRAN]
Enter one or more numbers, or an empty line to skip updates:
3
WARNING: Rtools is required to build R packages, but is not currently installed.
Please download and install Rtools custom from http://cran.r-project.org/bin/windows/Rtools/.
√ checking for file 'C:\Users\awuttke\AppData\Local\Temp\RtmpeA6c5f\remotes24d87bda938\cttobin-ggthemr-10eb50a/DESCRIPTION' (368ms)
`> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 rstudioapi_0.10 magrittr_1.5 usethis_1.5.1
[5] devtools_2.2.1 pkgload_1.0.2 R6_2.4.1 rlang_0.4.3
[9] fansi_0.4.1 tools_3.6.0 pkgbuild_1.0.6 packrat_0.5.0
[13] sessioninfo_1.1.1 cli_2.0.1 withr_2.1.2 ellipsis_0.3.0
[17] remotes_2.1.0 assertthat_0.2.1 digest_0.6.23 rprojroot_1.3-2
[21] crayon_1.3.4 processx_3.4.1 callr_3.4.1 fs_1.3.1
[25] ps_1.3.0 curl_4.0 testthat_2.3.1 memoise_1.1.0
[29] glue_1.3.1 compiler_3.6.0 desc_1.2.0 backports_1.1.4
[33] prettyunits_1.1.1`
Objective: To only update the palette with custom colors, nothing else.
Tried:
my_palette <- define_palette(
swatch = structure(c(
'#fdf6e3',
'#207DE8', '#1ABC9C',
'#E3CA09', '#DB46BE',
'#B3CF00', '#E63535',
'#9959EB', '#EB9A02')),
gradient = c(low = '#f1c40f', high = '#c0392b')
)
ggthemr(my_palette, set_theme = FALSE)
Returns an error and a large printed text (a portion of it shown below).
$theme
List of 58
$ line :List of 6
..$ colour : chr "#6e6e6e"
..$ size : num 0.5
..$ linetype : num 1
..$ lineend : chr "butt"
..$ arrow : logi FALSE
..$ inherit.blank: logi TRUE
..- attr(*, "class")= chr [1:2] "element_line" "element"
$ rect :List of 5
..$ fill : chr "white"
..$ colour : chr "#444444"
..$ size : num 0.5
..$ linetype : num 1
..$ inherit.blank: logi TRUE
..- attr(*, "class")= chr [1:2] "element_rect" "element"
$ text :List of 11
..$ family : chr ""
..$ face : chr "plain"
..$ colour : chr "#444444"
..$ size : num 12
..$ hjust : num 0.5
..$ vjust : num 0.5
..$ angle : num 0
..$ lineheight : num 0.9
..$ margin :Classes 'margin', 'unit' atomic [1:4] 0 0 0 0
.. .. ..- attr(*, "valid.unit")= int 8
.. .. ..- attr(*, "unit")= chr "pt"
..$ debug : logi FALSE
..$ inherit.blank: logi TRUE
..- attr(*, "class")= chr [1:2] "element_text" "element"
$ axis.title :List of 11
..$ family : NULL
..$ face : chr "bold"
..$ colour : chr "#444444"
..$ size : NULL
..$ hjust : NULL
..$ vjust : NULL
..$ angle : NULL
..$ lineheight : NULL
..$ margin : NULL
..$ debug : NULL
..$ inherit.blank: logi TRUE
..- attr(*, "class")= chr [1:2] "element_text" "element"
$ axis.title.x :List of 11
..$ family : NULL
..$ face : NULL
..$ colour : NULL
..$ size : NULL
..$ hjust : NULL
..$ vjust : num -0.78
..$ angle : NULL
..$ lineheight : NULL
..$ margin :Classes 'margin', 'unit' atomic [1:4] 0 0 0 0
.. .. ..- attr(*, "valid.unit")= int 8
.. .. ..- attr(*, "unit")= chr "pt"
..$ debug : logi FALSE
..$ inherit.blank: logi TRUE
Full printed output: https://gist.github.com/neilpanchal/685c02fe19b796adbb3c8692690d33ed
My session information:
R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin16.4.0 (64-bit)
Running under: macOS Sierra 10.12.4
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggthemr_1.1.0 dplyr_0.5.0 purrr_0.2.2
[4] readr_1.1.0 tidyr_0.6.1 tibble_1.3.0
[7] ggplot2_2.2.1 tidyverse_1.1.1.9000 extrafont_0.17
loaded via a namespace (and not attached):
[1] Rcpp_0.12.10 plyr_1.8.4 forcats_0.2.0
[4] tools_3.3.3 digest_0.6.12 uuid_0.1-2
[7] lubridate_1.6.0 gtable_0.2.0 jsonlite_1.4
[10] evaluate_0.10 nlme_3.1-131 lattice_0.20-34
[13] psych_1.7.3.21 IRdisplay_0.4.4 DBI_0.6-1
[16] IRkernel_0.8.6.9000 parallel_3.3.3 haven_1.0.0
[19] Rttf2pt1_1.3.4 xml2_1.1.1 httr_1.2.1
[22] repr_0.12.0 stringr_1.2.0 hms_0.3
[25] grid_3.3.3 R6_2.2.0 readxl_0.1.1
[28] foreign_0.8-67 pbdZMQ_0.2-5 modelr_0.1.0
[31] reshape2_1.4.2 extrafontdb_1.0 magrittr_1.5
[34] scales_0.4.1 rvest_0.3.2 assertthat_0.2.0
[37] mnormt_1.5-5 colorspace_1.3-2 labeling_0.3
[40] stringi_1.1.5 lazyeval_0.2.0 munsell_0.4.3
[43] broom_0.4.2 crayon_1.3.2
How can I update a custom palette, and leave everything else unchanged?
devtools::install_github('cttobin/ggthemr')
Downloading GitHub repo cttobin/ggthemr@master
from URL https://api.github.com/repos/cttobin/ggthemr/zipball/master
Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached
Each time I use "ggthemr" to change my theme, I have to change the colors manually. It seems that function ggthemr()
does nothing to colors.
Here are my codes as an example.
library(ggplot2)
library(ggthemr)
ggthemr("chalk", "scientific")
ggplot(mpg, aes(displ, hwy, color = factor(cyl), shape = factor(cyl))) +
geom_jitter() +
geom_smooth(method = lm, formula = y ~ poly(x, 2)) +
labs(shape = "cyl", color = "cyl")
library(ggplot2)
library(ggthemr)
ggthemr("chalk", "scientific")
defaultColor <- swatch()[seq_len(swatch())]
ggplot(mpg, aes(displ, hwy, color = factor(cyl), shape = factor(cyl))) +
scale_color_manual(values = defaultColor[2:5]) +
geom_jitter() +
geom_smooth(method = lm, formula = y ~ poly(x, 2)) +
labs(shape = "cyl", color = "cyl")
I think some recent changes to ggplot2
internals have broken ggthemr
. for instance
library(ggplot2)
library(ggthemr)
ggplot(mtcars, aes(wt, mpg)) + geom_point()
works fine
but invoking ggthemr
ggthemr("greyscale")
results in this error message
Error: No geom called GeomJitter.
In addition: Warning messages:
1: `axis.ticks.margin` is deprecated. Please set `margin` property of `axis.text` instead
2: New theme missing the following elements: panel.ontop, strip.switch.pad.grid, strip.switch.pad.wrap
and an attempt to call ggplot
:
ggplot(mtcars, aes(wt, mpg)) + geom_point()
results in:
Error in if (theme$panel.ontop) { : argument is of length zero
hope this gets addressed--ggthemr
produces fantastic looking plots!
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggthemr_1.0.1 devtools_1.8.0 ggplot2_1.0.1.9003
loaded via a namespace (and not attached):
[1] Rcpp_0.12.0 digest_0.6.8 grid_3.2.2 plyr_1.8.3.9000
[5] gtable_0.1.2 git2r_0.11.0 scales_0.2.5.9003 curl_0.9.2
[9] xml2_0.1.1 labeling_0.3 tools_3.2.2 munsell_0.4.2
[13] rversions_1.0.2 colorspace_1.2-6 memoise_0.2.1
Hey, any chance to get a package for the latest R version?
Hi,
I tried to install your package and get an error message:
Warning in install.packages :
package ‘ggthemr’ is not available (for R version 3.5.3)
Any plans to get this working for the current version of R?
Great work on this package! Could you please add licence for this repo? https://help.github.com/articles/adding-a-license-to-a-repository/
Hi there,
Thanks for developing a cool package! :)
It is used in production as part of the data analytics pipeline for the response to Ebola in North Kivu, DRC. So far we put ggthemr on our deployer but it'd be nice to know if / when a CRAN release is to be expected. Any rough ETA?
Dear team,
Owing to some network security issue, I cannot install this package by using following commend:
devtools::install_github('cttobin/ggthemr'),
How can I install this package without Internet connection?
Thanks nad best regardsm
James Chang
Everytime I load a theme with gthemr() it warns as below:
panel.margin
is deprecated. Please use panel.spacing
property insteadlegend.margin
must be specified using margin()
. For the old behavior use legend.spacingNew theme missing the following elements: axis.title.x.top, axis.title.y.right, axis.text.x.top, axis.text.y.right, legend.spacing.x, legend.spacing.y, legend.box.margin, legend.box.background, legend.box.spacing, panel.spacing.x, panel.spacing.y, plot.subtitle, plot.caption, strip.placement.
Can these missing elements be defaulted so that this warning stops appearing?
Code:
rose_pine = define_palette(
background = '#1f1d2e',
text = list(inner = '#555169', outer = '#e0def4'),
line = list(inner = '#e0def4', outer = '#c4a7e7'),
gridline = '#504940',
swatch = structure(c(
'#e0def4',
'#eb6f92', '#f6c177',
'#ebbcba', '#31748f',
'#9ccfd8', '#c4a7e7'), class = 'ggthemr_swatch'),
gradient = list(low='#31748f', high='#9ccfd8')
)
ggthemr(rose_pine)
Error:
Error in UseMethod("is_colour", x) :
no applicable method for 'is_colour' applied to an object of class "ggthemr_swatch"
renv
fails to install ggthemr, because the DESCRIPTION file does not match the stated UTF-8 encoding.
The offender is "Daróczi", where the ó character is written in ANSI, but is an invalid 0xF3 character in UTF-8.
Instead, you should be using "Daróczi".
Please convert the DESCRIPTION file to UTF-8, e.g. by using Notepad++ Encoding->Convert to UTF-8.
Reprex:
renv::install("Mikata-Project/ggthemr")
Error message: DESCRIPTION file at 'C:/Users/XXXX/R-4.1/x86_64-w64-mingw32/ggthemr/DESCRIPTION' is empty
With a theme set by ggthemr, a plot created with ggplot2 cannot be displayed (printed):
library("ggplot2")
library("ggthemr")
plt01 <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
plt01 # the plot is shown
ggthemr('dust')
plt02 <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
plt02
#> Error in if (tag_pos == "manual") { : argument is of length zero
sessionInfo()
#> R version 3.4.3 (2017-11-30)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 16.04.4 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/atlas-base/libf77blas.so.3.0
#> LAPACK: /home/R/R-3.4.3/lib/R/lib/libRlapack.so
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] ggthemr_1.1.0 ggplot2_2.2.1.9000
#>
#> loaded via a namespace (and not attached):
#> [1] labeling_0.3 colorspace_1.3-2 scales_0.5.0.9000 compiler_3.4.3
#> [5] lazyeval_0.2.1 plyr_1.8.4 withr_2.1.2 pillar_1.2.1
#> [9] gtable_0.2.0 tibble_1.4.2 Rcpp_0.12.16 grid_3.4.3
#> [13] rlang_0.2.0.9001 munsell_0.4.3
Hi,
first of all thanks for this great package.
I really like the different themes of ggthemr. However i would like to make further adjustments. For example I want to change the font face of the labelling from 'bold' to 'normal'.
What is the preferred way of doing those adjustments to a chosen theme?
Thanks in advance
Hi, first of all, thanks a lot for this package 👍
With the most recent version of ggplot2
on CRAN (3.0), there are a couple of new theme
elements:
That are causing a warning
now:
New theme missing the following elements: panel.grid, plot.tag, plot.tag.position
Is it something you can easily fix or should I look into it and come up with a PR?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.