2017-02-03-graphics-imas's Issues
notes from session
Pulled from the etherpad
R Graphics and Mapping
samples on a map, bathymetry
map projections sp::spTransform raster::projectRaster
avoid reprojecting rasters and remodelling data, use extract
overlaying satellite data raster::extract(grid, polygon/points)
pkg:Raster
- super versatile, can handle many different formats
labels
use ggplot2 for better labelling
tip: use base map with labels already included
otherwise rely on manually entering spatial points and custom labels
SCAR gazetteer for placenames in R package:
https://github.com/AustralianAntarcticDataCentre/antanym
custom polygons
- use qgis
legends
- ggplot good for legends (sometimes incompatible)
What do you need?
-
make a map from my field samples
-
a nice map of the Southern ocean!
leaflet() https://rpubs.com/bhaskarvk/leaflet-polarmaps -
quick tranformations of map projections
- http://proj4.org/ proj4 has documentation on projection formation that can be used to transform data
- Help overlaying spatial data on maps eg. satellite data. +1
- automatic? Cartographic labels of ocean features eg. Bounty Trough, Tasman Rise etc.
creating custom polygons
editting shapfiles ?polylines?
*shape files in maps
*visually appealing plots
*regional SO map, plot sample data over oceanographic/bathymetry data
*pretty figures also...how to make plots with lots of data points clear
*Create a legend
*Fix scales-make them meaningful - Make colour bars with labels
-
viridis colour palette; good contrast and colour blind friendly colours
*Add background colour and pictures to plots
*raster layers- the basics -
CCAMLR gis package available with relevant polygons/data layers for Southern Ocean biology; predominantly CCAMLR management areas
Piping:
Avoids nesting within functions...and indecipherable code.
Reorganises code
PLaces to find help/tutorials:
Data Carpentry
DataScienceHobart Github site > ISSUES
Software Carpentry Creating Publication-Quality Graphics
Rpubs http://rpubs.com/cyclemumner/aad-mapping-tips
Rpubs https://rpubs.com/bhaskarvk/leaflet-polarmaps
Aggregating isobaths
Hey @mdsumner,
Wondering how you work out the intervals between isobaths when aggregating etopo?
Here's how I've been making them (for anyone interested):
rasterToContour(aggregate(topo1, fact=16, fun=mean))
Can't open etopo from Gough- so needing to guess/work out what a fact=16 equates to...200m?
Cheers,
J.
lessons from the Aleutians
- in/out extent specification
- graticule across dateline problem
- juggling projection metadata objects
- misunderstandings of source/target, graticule as long/lat, vs. projected
- role of asp/ ratio
- what does the projected end point look like versus 170, 180, -180, -170 etc. (i.e. implicit wrap confusion)
- role of spTransform as a high level on project(xy, inv = TRUE/FALSE)
- the seam in continent at -180/180 (removed with ms_simplify/gUnionCascaded
- North arrows are of limited utility
-relationship between plot(extent, asp = 1) and par(mar, xpd)
Add ice edge to maps
Hi Mike,
It would be great if you could cover how to add the mean ice extent in the Antarctic for September (a line) to my maps.
cheers,
Nat
Create a map detailing study site and oceanographic features
Hi Mike,
I'm posting this one for someone else (they're having issues with GitHub). How can we create a really nice map to show a study site, including oceanographic features etc?
thanks
Boxplots
Hey Mike,
I was wondering if there is anyway to make the attached boxplot more visually appealing?
The data file is to big to load.
The code I use:
library(ggplot2)
library(plotrix)
library(gridExtra)
library(ggthemes)
p1 <- ggplot(surv, aes(x=age, y=values))
p1+facet_grid(species~sex, scales="free_y")
p <- ggplot(surv, aes(factor(age, levels=c("Pup", "Juvenile", "Adult")), values))+
theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
strip.background = element_rect(colour="black", fill="white"),
strip.background = element_blank())#### Removes everything
p + geom_boxplot() +facet_grid(sex~species, scales="free_y") +
ylab("Survival probability") + xlab('Age class')
how to snapshot zoomed in leaflet
Tried this code, how to save as image zoomed into Macquarie Island?
library(orsifronts) ## install. packages("orsifronts")
library(leaflet) ## install.packages("leaflet")
## orsifronts is a SpatialPolygonsDataFrame (could be read via shapefile, or contoured from other data)
data(orsifronts)
fronts_as_points <- as(orsifronts, "SpatialPointsDataFrame")
fronts_as_points <- fronts_as_points[sample(nrow(fronts_as_points), 20), ]
leaflet() %>% leaflet::setMaxBounds(130, -60, 160, -40) %>%
addProviderTiles(providers$Esri.NatGeoWorldMap) %>%
addPolylines(data = rmapshaper::ms_simplify(orsifronts),
color = ~colorFactor(viridis::viridis(nrow(orsifronts)), front)(front)) %>%
addMarkers(data = fronts_as_points, label = ~front, labelOptions = labelOptions(noHide = TRUE))
Environmental data from extent using raadtools
Hey @mdsumner,
Just had a query from Dahlia about extracting remotely sensed data from an extent object using raadtools.
Do you already have a tutorial for this? Or shall we make a new markdown for it?
Cheers,
Jaimie
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.