Skip to content

Instantly share code, notes, and snippets.

View jonovik's full-sized avatar

Jon Olav Vik jonovik

  • Centre for integrative genetics
  • Ås, Norway
View GitHub Profile
@jonovik
jonovik / gg_to_clipboard.R
Last active June 29, 2023 13:29 — forked from dpashouwer/gg_to_clipboard
Copy ggplot to clipboard
# pacman::p_load(tidyverse)
gg_to_clipboard <- function(plot = last_plot(), width = 1000, height = 600, pointsize = 40){
win.graph(width = width, height = height, pointsize = pointsize)
plot %>% print()
savePlot("clipboard", type = "wmf")
dev.off()
}
# ggplot(data = mtcars, aes(x = mpg)) + geom_histogram()
@jonovik
jonovik / codegen.py
Created May 20, 2011 07:56 — forked from mattbasta/codegen.py
A module to "unparse" a Python AST tree.
# -*- coding: utf-8 -*-
"""
codegen
~~~~~~~
Extension to ast that allow ast -> python code generation.
:copyright: Copyright 2008 by Armin Ronacher.
:license: BSD.
"""