Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
library( package = 'ggplot2' )
# Coordenadas de las esquinas del Cuadro
cuadro <- data.frame( x = c(0,0,1,1,0)
, y = c(0,1,1,0,0)
)
# Coordenadas de la diagonal
recta <- data.frame( x = c(0,1)
, y = c(0,1)
)
# 15k puntos generados por medio de la distribución uniforme
puntos <- data.frame( x = runif(n = 15000 )
, y = runif(n = 15000 )
)
( ggplot()
+ geom_path( data = cuadro
, mapping = aes( x = x
, y = y
)
, size = 1
)
+ geom_path( data = recta
, mapping = aes( x = x
, y = y
)
, size = 1
)
+ geom_point( data = puntos
, mapping = aes( x = x
, y = y
)
, size = 0.1
, col = 'dodgerblue'
)
+ theme_bw()
+ labs( x = 'X'
, y = 'Y'
)
+ coord_fixed()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.