-1

I am using R and i got this type of plot for my data using the ggplot library

enter image description here

Is it possible to change the style of the plot with one more like this?

enter image description here

I would like to change the font style and its size to those of python defalt. I would also like to delete the gray background and make black margins around the graph.

HABLOH
  • 460
  • 2
  • 12
  • 3
    Could you please provide a MWE for your plot. Otherwise it's much more hassle to provide you with an answer. The fonts can be changed with the `extrafont` package and all the other stuff is pretty easy as well. – hannes101 Feb 07 '20 at 16:18
  • Pablo, please make this question *reproducible*. This includes sample code (including listing non-base R packages), sample *unambiguous* data (e.g., `dput(head(x))` or `data.frame(x=...,y=...)`), and expected output. Refs: https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. – r2evans Feb 07 '20 at 16:54

2 Answers2

1

You can use predefined themes: https://ggplot2.tidyverse.org/reference/ggtheme.html especially theme_classic()

or you can make your own theme by modifying some elements of the theme: https://ggplot2.tidyverse.org/reference/theme.html

Quentin
  • 360
  • 1
  • 4
  • 14
0

You can change the line color with geom_line(color = "#1f77b4").
Add an horizontal line with geom_hline(yintercept = 0.05, color = "#d62728")

(source of color codes : https://matplotlib.org/users/dflt_style_changes.html#colors-color-cycles-and-color-maps)

i94pxoe
  • 577
  • 3
  • 11