This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgeos) | |
data(wrld_simpl) | |
plot(wrld_simpl, col='white', bg='grey9', border=NA) | |
limx <- c(-6,1) | |
limy <- c(49,60) | |
plot(wrld_simpl, xlim=limx, ylim=limy, col='white', bg='grey9', border=NA) | |
# Apply RDP algorithm with distance variable = 0.4 degrees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Galaxy collisions | |
Star[] Stars; | |
PVector[] galp; | |
PVector[] galv; | |
color[] galcol, galcol2; | |
boolean paused = false; | |
int side = 100; // border around Stars' initial positions | |
int Startot = 300; // number of Stars | |
int obsize = 10; // size of Stars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Processing script to resolve a frame rotation problem | |
float zoom; | |
PVector a, b, pvec; | |
void setup() | |
{ | |
size(800, 600, P3D); | |
a = new PVector(0.0, 0.0, 0.0); | |
b = new PVector(200.0, 400.0, -600.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Branch[] trees; | |
int N = 5; | |
int Norig = N; | |
int ntrees = 10; | |
int area = 600; | |
boolean HD = false; | |
boolean HDswitch = false; | |
boolean levelswitch = false; | |
boolean levelup; | |
boolean spin = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Data for this is available at https://dl.dropbox.com/u/46043231/data/twit.csv | |
String[][] allData; | |
int[][] grid; | |
int[][][] agGrid; | |
float[] count; | |
int[][] boxHeight; | |
int res = 35; // range from 20-50 | |
float latmin = 51.2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<body> | |
<div id="viz"></div> | |
<div id="status" style="position:fixed; bottom:0; left:0; | |
color:white; background-color:darkgreen; font-size:small"></div> | |
<script type="text/javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code for a walking stickman | |
// by geotheory.co.uk (2013) | |
Stickman Stanley; | |
int grnd; | |
void setup() { | |
size(200, 200); | |
grnd = height-20; | |
frameRate(30); | |
smooth(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plotting 3D maps using OpenStreetMap and RGL. For info see: | |
# http://geotheory.co.uk/blog/2013/04/26/plotting-3d-maps-with-rgl/ | |
map3d <- function(map, ...){ | |
if(length(map$tiles)!=1){stop("multiple tiles not implemented") } | |
nx = map$tiles[[1]]$xres | |
ny = map$tiles[[1]]$yres | |
xmin = map$tiles[[1]]$bbox$p1[1] | |
xmax = map$tiles[[1]]$bbox$p2[1] | |
ymin = map$tiles[[1]]$bbox$p1[2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' GGPLOT2 FUNCTIONALITY FOR MAPPING TO HEXAGON SIZE AND COLOUR AESTHETICS | |
#' by Robin Edwards, 2013 (geotheory.co.uk, @geotheory) | |
#' This has been adapted from the ggplot bin_hex.R script that underpins geom_hex, etc | |
#' (see https://github.com/hadley/densityvis/blob/master/R/bin-hex.r). | |
#' | |
#' These functions implement aesthetic mapping to hexagon size (area), in addition to the existing | |
#' colour-mapping functionality. The key change is the addition of a new fourth variable (var4) | |
#' to hex_bin(), which complements the inbuilt hexagon binning functionality. The 'frequency.to.area' | |
#' argument enables the default mappings of binned data to colour and var4 to size to be interchanged. | |
#' The hmin/hmax arguments [0,1] set area mapping constraints (hmax can exceed 1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Calibration-check points using Leaflet and D3</title> | |
<!-- Points are London O2 Arena, Washington Monument, Cape Town Stadium and the Sydney Opera House --> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
OlderNewer