AustralianAntarcticDivision / SOmap

Southern Ocean round maps
https://australianantarcticdivision.github.io/SOmap/
24 stars 6 forks source link

automap wackiness #46

Closed raymondben closed 4 years ago

raymondben commented 5 years ago
  1. SOauto_map(c(-122, 20), c(-78, -50)) crops the map to such an extent that it doesn't show the given points

SOauto_map(c(-122, 20), c(-78, -50), pcol = "red") does not

  1. Similarly,
    xy <- expand.grid(x = -120:20, y = -70:-50)
    SOauto_map(xy[,1], xy[,2])

    crops the map too much, but

    SOauto_map(xy[,1], xy[,2], trim_background = FALSE)

    does not. I think that the line

      target <- crop(target, extent(rgdal::project(cbind(xlim, ylim), prj)))

    is cropping too zealously, because it's only using the two corners of the (lat-lon) extent. Does:

      target <- crop(target, extent(rgdal::project(cbind(x, y), prj)))

    make more sense?

mdsumner commented 5 years ago

I don't see the difference in the 1. alternatives?

You are right this is screwed, I'll see if a quick fix helps but I was refactoring this

Maschette commented 5 years ago

I think this is an RStudio plot issue, I had i but then saved an image as a jpg and it was fine.

raymondben commented 5 years ago

Ignore number 1, I can't reproduce it now. Maybe it was a result of an odd graphics device state.

mdsumner commented 5 years ago

New scheme in branch

mdsumner commented 5 years ago

... it's only the internals, to give a target and xy (may be NULL) from various inputs - will smooth out SOauto_map in the branch

mdsumner commented 5 years ago

Now in https://github.com/AustralianAntarcticDivision/SOmap/pull/48

  library(SOmap)
#> Loading required package: raster
#> Loading required package: sp
#> Registered S3 methods overwritten by 'ggplot2':
#>   method         from 
#>   [.quosures     rlang
#>   c.quosures     rlang
#>   print.quosures rlang
  SOauto_map(c(-122, 20), c(-78, -50)) 


SOauto_map(c(-122, 20), c(-78, -50), pcol = "red")


xy <- expand.grid(x = -120:20, y = -70:-50)
SOauto_map(xy[,1], xy[,2])


SOauto_map(xy[,1], xy[,2], trim_background = FALSE)

Created on 2019-06-01 by the reprex package (v0.3.0)

Maschette commented 5 years ago

Not sure if I should put it here or make a new issue for new auto_map comments. Ill go here for now.

When I plot SOauto_map(c(160, -160), c(-50, -75)) i get this image in the window, but if i use reprex it works...

image

library(SOmap)
SOauto_map(c(160, -160), c(-50, -75))

Created on 2019-06-02 by the reprex package (v0.3.0)

raymondben commented 4 years ago

I think these are all resolved now in the dev branch