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

facet_trelliscope empty plot; scale_y_continuous(trans = "log2") #107

Open
dereckmezquita opened this issue Feb 9, 2021 · 0 comments
Open

Comments

@dereckmezquita
Copy link

dereckmezquita commented Feb 9, 2021

Cannot use the scale_y_continuous(trans = "log2") option together with facet_trelliscope(). In fact no options from scale_y_continuous() work.

The data disappears I get blank plots when using this option in trelliscope.

I get this error:

using data from the first layer
Scale for 'y' is already present. Adding another scale for 'y', which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y', which will replace the existing scale.

Am I doing something wrong? Here is a minimal example with some toy data. Note: run as a chunk:

library("tidyverse")
library("trelliscopejs")

{read.delim(text = 
'year	country	population	code	region
1800	"Afghanistan"	298000	"AFG"	"Southern Asia"
1801	"Afghanistan"	299000	"AFG"	"Southern Asia"
1802	"Afghanistan"	1100000	"AFG"	"Southern Asia"
1803	"Afghanistan"	3180000	"AFG"	"Southern Asia"
1804	"Afghanistan"	3280000	"AFG"	"Southern Asia"
1800	"Zimbabwe"	309000	"ZWE"	"Eastern Africa"
1801	"Zimbabwe"	309000	"ZWE"	"Eastern Africa"
1803	"Zimbabwe"	1100000	"ZWE"	"Eastern Africa"
1804	"Zimbabwe"	3100000	"ZWE"	"Eastern Africa"')} %>%
	ggplot(aes(year, population, group = country)) +
	geom_line() +
	scale_y_continuous(trans = "log2") +
	facet_trelliscope(~ region,
					scales = "same",
					name = "World population by region",
					desc = "Population of each country by country and region",
					nrow = 4, ncol = 4,
					as_plotly = TRUE,
					auto_cog = TRUE)

Screenshot 2021-02-08 at 22 03 44

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