finplot: finplot

View source: R/finplot.R

finplotR Documentation

finplot

Description

Plotting aide for Psec plotting functionalities.

Usage

finplot(
  g,
  x.comma.sep = FALSE,
  y.comma.sep = FALSE,
  x.pct = FALSE,
  x.pct_acc = 0.1,
  y.pct = FALSE,
  y.pct_acc = 0.1,
  zero.anchor = FALSE,
  x.vert = FALSE,
  y.vert = FALSE,
  x.ticks.rm = FALSE,
  y.ticks.rm = FALSE,
  legend_pos = NULL,
  col.hue = NULL,
  fill.hue = NULL,
  title.centre = FALSE,
  darkcol = FALSE,
  x.date.type = NULL,
  x.date.dist = NULL,
  x.date.vector.sel = NULL,
  legend.line.size = NULL,
  legend.text.size = NULL,
  legend.line.alpha = NULL,
  legend.title = NULL,
  log.y = FALSE,
  drop.grids = FALSE,
  drop.x.grids = FALSE,
  drop.y.grids = FALSE
)

Arguments

x.comma.sep

Make x axis not show scientific values (e.g. shows 25,000,000 as opposed to 2.5e+6)

y.comma.sep

Make y axis not show scientific values (e.g. shows 25,000,000 as opposed to 2.5e+6)

x.pct

Make x axis percentages

x.pct_acc

Rounding of pct value.

y.pct

Make y axis percentages

y.pct_acc

Rounding of pct value.

x.vert

flip x axis

y.vert

flip y axis

x.ticks.rm

Remove x ticks altogether

y.ticks.rm

Remove x ticks altogether

legend_pos

where to position legend. Defaults to bottom.

col.hue

set color hues. E.g., set hue = 40 to see what happens

fill.hue

set fill hues. E.g., set hue = 40 to see what happens

darkcol

Use dark colors

x.date.type

Of e.g. form '%Y', '%y_%b'

x.date.dist

Space between date points on x axis. E.g., "2 years", "10 week"

x.date.vector.sel

Provide a vector of possible dates - this way weekends and holidays are e.g. removed... use bdscale here. E.g. use: x.date.vector.sel = unique(df$date)

legend.line.size

Make legend lines larger

legend.text.size

Adj legend text

legend.line.alpha

Make legend lines lighter

log.y

Apply a log transformation on the y-axis. This is a log base 10 transformation

title.center

Put title in center of figure. Used with grids or facet wraps e.g.

Value

ggplot object

Examples

g <- ggplot() + geom_line(aes(date, returns, color = Funds)) + theme_fmx()
finplot(g, x.pct = TRUE)

Nicktz/fmxdat documentation built on Aug. 25, 2024, 10:18 a.m.