Skip to content

hypercompetent/xstitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xstitch

Functions to assist with cross-stitch pattern generation

Under development

Installation

if(!"devtools" %in% installed.packages()) {
  install.packages("devtools")
}

devtools::install_github("hypercompetent/xstitch")

Demo

library(reshape2)
library(ggplot2)
library(xstitch)

binned_volcano <- floor(volcano / 20)

volcano_df <- melt(binned_volcano)
names(volcano_df) <- c("x","y","value")

# factor conversion for plotting
volcano_df$value <- as.factor(volcano_df$value)

p <- ggplot(volcano_df) +
       geom_point(aes(x = x,
                      y = y, 
                      pch = value, 
                      color = value))

p <- stitch_lettering(p,
                      "Maunga Whau", 
                      anchor = c(30,64))

p <- add_grid(p, 
              x_range = c(1,90), 
              y_range = c(1,70))

p

About

Cross-Stitch plotting functions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages