Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
1 result

ccb_theme

  • Clone with SSH
  • Clone with HTTPS
  • Name Last commit Last update
    CCB_theme.R
    README.md

    CCB_theme

    Getting started

    Use this stylesheet to quickly modify the style of your ggplot plots to the CCB style, for publications. You can use the stylesheet file like so:

    Example code

    To utilize the "CCB_plot_style" function in your ggplot codes, simply incorporate it into your code. With "mycolor", you have the flexibility to select from various colors to represent your data.

    library(ggplot2)
    
    source("https://gitlab.cs.uni-duesseldorf.de/ghaffarinasabsharabiani/ccb_theme/-/blob/e41b78e11d2ce1d10498ba6ba345747482119f8c/CCB_theme.R")
    
    
    
    **##line chart with points**
    
    df=data.frame(x=1:10,y=rnorm(10))
    
    ggplot(df,aes(x=x,y=y))+
      geom_point()+
      geom_line(linewidth=1.5,color=mycolor[1])+
      CCB_plot_style()+
      scale_color_manual(values = mycolor) 
    
    
    
    **#Box_plot** 
    
    ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
      geom_line() +
      ggtitle("Custom color palette") +
      CCB_plot_style()+
      scale_color_manual(values = mycolor)