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

new plot function for streamgraphs #36

Open
7yl4r opened this issue Oct 19, 2017 · 0 comments
Open

new plot function for streamgraphs #36

7yl4r opened this issue Oct 19, 2017 · 0 comments

Comments

@7yl4r
Copy link
Member

7yl4r commented Oct 19, 2017

Breaking this issue out from #21

@reikopm is wants a plotter for eDNA data and provides R code for creating a stacked bar graph:

txt = "urlstr='https://raw.githubusercontent.com/reikopm/info-mb/master/prep/data/phytoplankton/efm_taxa_structure_means.csv'
dat <- read.csv(url(urlstr))
dat$Season <- factor(dat$Season, levels = c("Spring", "Summer", "Fall", "Winter"))

library(plotly)

t <- list(
family = 'helvetica',
size = 24,
color = 'black')

p1 <- plot_ly(dat, x = ~Season, y = ~asyn, type = 'bar', name = 'Synechococcus',width=2040, height=1080) %>%
add_trace(y = ~arfp, name = 'Red Fluorescing Picoplankton') %>%
add_trace(y = ~aprym, name = 'Haptophyte') %>%
add_trace(y = ~aaflag, name = 'Autotrophic Flagellate') %>%
add_trace(y = ~aadino, name = 'Autotrophic Dinoflagellate') %>%
add_trace(y = ~acryp, name = 'Cryptomonad') %>%
add_trace(y = ~aprasy, name = 'Prasinophyte') %>%
add_trace(y = ~aphaeo, name = 'Phaeocystsis') %>%
add_trace(y = ~apen, name = 'Pennate Diatom') %>%
add_trace(y = ~acen, name = 'Centric Diatom') %>%
add_trace(y = ~ahdino, name = 'Heterotrophic Dinoflagellate') %>%
add_trace(y = ~ahflag, name = 'Heterotrophic Flagellate') %>%
add_trace(y = ~achoano, name = 'Choanoflagellate') %>%
add_trace(y = ~ahcryp, name = 'Leucocryptos') %>%
add_trace(y = ~ahcil, name = 'Heterotrophic Ciliate') %>%
add_trace(y = ~aacil, name = 'Autotrophic Ciliate') %>%
layout(font=t,yaxis = list(title = 'mg C m-3'),barmode = 'stack') %>%
layout(font=t,title = 'Q10:Taxonomic Structure', margin = 1)
print(p1)"

image

This is also a good use-case for a streamgraph, so perhaps we should include a new plot-function option (ie a new .rmd.brew file in ./inst/plotting_functions/)

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

No branches or pull requests

1 participant