# DAL ToolBox
# version 1.01.727
source("https://raw.githubusercontent.com/cefet-rj-dal/daltoolbox/main/jupyter.R")
#loading DAL
load_library("daltoolbox")
Loading required package: daltoolbox Registered S3 method overwritten by 'quantmod': method from as.zoo.data.frame zoo Attaching package: ‘daltoolbox’ The following object is masked from ‘package:base’: transform
load_library("ggplot2")
load_library("RColorBrewer")
#color palette
colors <- brewer.pal(4, 'Set1')
# setting the font size for all charts
font <- theme(text = element_text(size=16))
Loading required package: ggplot2 Loading required package: RColorBrewer
x <- seq(0, 10, 0.25)
serie <- data.frame(x, sin=sin(x), cosine=cos(x)+5)
head(serie)
x | sin | cosine | |
---|---|---|---|
<dbl> | <dbl> | <dbl> | |
1 | 0.00 | 0.0000000 | 6.000000 |
2 | 0.25 | 0.2474040 | 5.968912 |
3 | 0.50 | 0.4794255 | 5.877583 |
4 | 0.75 | 0.6816388 | 5.731689 |
5 | 1.00 | 0.8414710 | 5.540302 |
6 | 1.25 | 0.9489846 | 5.315322 |
A point plot is similiar to series plot without drawing lines.
# The function returns a preset graphic that can be enhanced.
grf <- plot_points(serie, colors=colors[1:2])
# Increasing the font size of the graphics
grf <- grf + font
# Actual plot
plot(grf)