Skip to content

Commit ecdf37c

Browse files
committed
use coord_sf for y-rev
1 parent 4cc7476 commit ecdf37c

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

R/class.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#' For \code{Shape/PointFrame}s, an \code{arrow} Table or derivative.
1515
#' @param zattrs \code{Zattrs} objects; used to represent .zattrs.
1616
#' @param metadata (option) list of free-form extra data.
17-
#' @param x \code{SpatialData} object.
1817
#' @param ... ignored.
1918
#'
2019
#' @return \code{SpatialData}

R/plot-image.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ sd_plot_image <- \(x, i=1, c=NULL, ch=NULL, cl=NULL, k=NULL, w=800, h=800) {
5959
scale_color_identity(NULL, guide="legend", labels=names(pal)),
6060
geom_point(aes(col=.data$foo), data.frame(foo=pal), x=0, y=0, alpha=0))
6161
list(lgd,
62-
scale_x_continuous(limits=w), scale_y_reverse(limits=rev(h)),
62+
scale_x_continuous(limits=w), scale_y_continuous(limits=h),
6363
annotation_raster(a, w[2],w[1], h[2],h[1], interpolate=FALSE))
6464
}
6565

R/plot-label.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ sd_plot_label <- \(x, i=1, c=NULL, alpha=1, k=NULL, w=800, h=800) {
4545
w <- c(0, dim(la)[2])
4646
h <- c(0, dim(la)[1])
4747
list(
48-
scale_x_continuous(limits=w), scale_y_reverse(limits=rev(h)),
49-
annotation_raster(a, w[2],w[1], h[1],h[2], interpolate=FALSE))
48+
scale_x_continuous(limits=w), scale_y_continuous(limits=h),
49+
annotation_raster(a, w[2],w[1], h[2],h[1], interpolate=FALSE))
5050
}

R/plot.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#' @import ggplot2
2525
#' @export
2626
sd_plot <- \() ggplot() +
27-
scale_y_reverse() +
28-
coord_equal() +
27+
#coord_sf(reverse="y") +
28+
#coord_equal() +
2929
theme_bw() + theme(
3030
panel.grid=element_blank(),
3131
legend.key=element_blank(),

man/SpatialData.Rd

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/SpatialData.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,17 @@ invisible(CTpath(y, j))
153153
```{r fig.width=8, fig.height=8}
154154
sd_plot() + sd_plot_image(x) +
155155
sd_plot() + sd_plot_point(x, c="x") +
156-
sd_plot() + sd_plot_shape(x, 3) + # TODO: no y-rev?
156+
sd_plot() + sd_plot_shape(x, 3) +
157157
sd_plot() + sd_plot_label(x, c=c("lavender", "blue"))
158158
```
159159

160160
```{r fig.width=4, fig.height=4}
161161
sd_plot() +
162+
coord_sf(reverse="y") +
162163
sd_plot_image(x) +
163164
sd_plot_label(x, c=rainbow(10), alpha=2/3) +
164-
sd_plot_point(x, c="yellow")
165+
sd_plot_shape(x, 3, fill="black", linewidth=1) +
166+
sd_plot_point(x, c="yellow", size=1/3)
165167
```
166168

167169
# Session info

0 commit comments

Comments
 (0)