You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However the legends are printing over each other - This does not appear to be helped by setting the key value to True or False. I have attached an image file to show what is being produced by the code above.
Any suggestions?
Thanks in advance
Matt
The text was updated successfully, but these errors were encountered:
@davidcarslaw may have an answer from within {openair} itself, but if you're comfortable with {ggplot2} you could give this a go w/ the in-development {ggopenair}. Under that framework the time variation plots are {patchwork} ensembles so you can pull the individual panels out and treat them however you'd like:
library(patchwork)
# import datadat<-openair::importAURN(c("my1", "kc1"))
# run timevar to get lower panels without legendstimevar<-ggopenair::trend_variation(
dat, group="site"
)
# index to get panels of interestdays<-timevar[[2]][[2]]
month<-timevar[[2]][[3]]
# run again to get the hour panel with a legendhour<-ggopenair::trend_variation(
dat, group="site",
return="hour"
) +ggplot2::labs(color=NULL, fill=NULL)
# patchwork it together
(
(
(days|month|hour) /
(days|month|hour) /
(days|month|hour)
) &ggplot2::theme_bw() &ggplot2::theme(legend.position="top")
) +patchwork::plot_layout(guides="collect")
That is really helpful and thank you for taking the time to write such a comprehensive reply. I thought i'd share with you the output as you facilitated it.
Presumably now it is compatible with ggplot2 you can change the line types to dashes as well as the line colour?
I figured I could do this in openair using cols and lty as per the below - Is hat possible using this combination of ggopenair?
Question
Hi David,
I am using the split function to create a 3 column 4 row plot of multiple time variation subplots (a-d) i.e.
However the legends are printing over each other - This does not appear to be helped by setting the key value to True or False. I have attached an image file to show what is being produced by the code above.
Any suggestions?
Thanks in advance
Matt
![Timevariation split plot](https://private-user-images.githubusercontent.com/122517380/280261649-d1314201-13b9-497b-8720-aa71c2d4c808.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDE1NTQsIm5iZiI6MTczOTY0MTI1NCwicGF0aCI6Ii8xMjI1MTczODAvMjgwMjYxNjQ5LWQxMzE0MjAxLTEzYjktNDk3Yi04NzIwLWFhNzFjMmQ0YzgwOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQxNzQwNTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yMjNlNDQ0OTM5ODkyNjA0MjViNmM3NmVhMTVjZGRhZjMzZDUxMjEwN2IzZGVjNTkwNzk4NjJkZmRiYjNjNWQxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.KFkkHsIsJinNi7rGszFHOtb7TOv42geblDrLX74A0oA)
The text was updated successfully, but these errors were encountered: