Save a ggplot object to a PNG figure

write_fig(
  plt,
  filename = "myfigure",
  y_reverse = FALSE,
  x_reverse = FALSE,
  width = 7,
  height = 5.5,
  dpi = 200
)

Arguments

plt

a ggplot object, the object to be saved.

filename

a string, the file names of the saved figure, default as `myfigure`.

y_reverse

a logical value, whether reverse the graph by y-axis, default as FALSE.

x_reverse

a logical value, whether reverse the graph by x-axis, default as FALSE.

width

a positive real, the width of the saved figure, default as 7.

height

a positive real, the height of the saved figure, default as 5.5.

dpi

a positive integer, the resolution of the figure, default as 200.