Skip to content

Commit

Permalink
Merge pull request #16 from stscl/dev
Browse files Browse the repository at this point in the history
update `spc` plot s3 method
  • Loading branch information
SpatLyu authored Jan 23, 2025
2 parents c0b38e0 + cfbd3d6 commit 2a2050c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Imports:
magrittr,
parallel,
purrr,
RColorBrewer,
sdsfun (>= 0.7.0),
sf,
tibble,
Expand Down
4 changes: 2 additions & 2 deletions R/spc.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ plot.spc_result = \(x, style = c("network","matrix"), ...) {
fig_g = ggplot2::ggplot(data = g,
ggplot2::aes(x = yv, y = xv, fill = correlation)) +
ggplot2::geom_tile(color = "white") +
ggplot2::scale_fill_gradientn(colors = RColorBrewer::brewer.pal(11, "RdBu"),
limits = range(g$correlation)) +
ggplot2::scale_fill_gradient2(low = "blue", mid = "gray",
high = "red", midpoint = 0) +
ggplot2::geom_text(ggplot2::aes(label = round(correlation, 3)), color = "black") +
ggplot2::labs(x = "Dependent Variable", y = "Independent Variable") +
ggplot2::coord_equal() +
Expand Down
Binary file modified man/figures/cisp/plot_g2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion vignettes/cisp.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ system.time({
g = cisp::spc(ndvi,cores = 6)
})
## user system elapsed
## 1.14 0.30 23.16
## 0.84 0.20 21.50
g
## *** Spatial Pattern Correlation
##
Expand Down

0 comments on commit 2a2050c

Please sign in to comment.