Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhancing spatial visualization in ggplot2

NotificationsYou must be signed in to change notification settings

paleolimbot/ggspatial

Repository files navigation

ggspatial on CRANCoverage StatusLifecycle: stableR-CMD-check

Spatial data plus the power of theggplot2 framework means easiermapping.

Installation

The package is available on CRAN, and can be installed usinginstall.packages("ggspatial"). The development version can beinstalled viaremotes.

install.packages("ggspatial")

Or for the development version:

install.packages("remotes")# if remotes isn't installedremotes::install_github("paleolimbot/ggspatial")

Introduction

This package is a framework for interacting with spatial data usingggplot2 as a plotting backend. The package supportssf packageobjects,sp package objects, andraster package objects, andusesgeom_sf() andcoord_sf() to do most of the heavy lifting withrespect to coordinate transformation.

library(ggplot2)library(ggspatial)load_longlake_data()ggplot()+# loads background map tiles from a tile source  annotation_map_tile(zoomin=-1)+# annotation_spatial() layers don't train the scales, so data stays central  annotation_spatial(longlake_roadsdf,size=2,col="black")+  annotation_spatial(longlake_roadsdf,size=1.6,col="white")+# raster layers train scales and get projected automatically  layer_spatial(longlake_depth_raster, aes(colour= after_stat(band1)))+# make no data values transparent  scale_fill_viridis_c(na.value=NA)+# layer_spatial trains the scales  layer_spatial(longlake_depthdf, aes(fill=DEPTH_M))+# spatial-aware automagic scale bar  annotation_scale(location="tl")+# spatial-aware automagic north arrow  annotation_north_arrow(location="br",which_north="true")

About

Enhancing spatial visualization in ggplot2

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors11

Languages


[8]ページ先頭

©2009-2025 Movatter.jp