Firstly, the area distortion is pretty minor, so I would just convert to
lat-long and be done with it.

Oh wait, you are using ggplot2 to plot maps with +coord_equal(). There's
your fail.

If you project and plot with base graphics, then sp's plot function knows
you are plotting lat-long and sets the aspect ratio to give a decent view.
Try this:

require(rgdal)
polyL = spTransform(poly,CRS("+init=epsg:4326"))
plot(polyL)
axis(1);axis(2)

Looks okay, right? The aspect ratio isn't 1 here.

What is it? Well, on the equator it would be 1,  and simple trig will
suggest it goes with the inverse of the cosine of the latitude. What's the
middle of your data?

 > bb = bbox(polyL)
 > bb
         min        max
x -122.76891 -119.09532
y   51.42396   53.94661

 > mean(bb[2,])
[1] 52.68528

so the ratio is:

 > rat = 1/cos(52.68*pi/180)
 > rat
[1] 1.649441

then:

 ggplot(polyL) +
  aes(long,lat,group=group, fill = id) +
  geom_polygon() +
  geom_path(color="white") +
  coord_fixed(ratio=rat)

looks good.

Its possibly ggmap can do all this for you....

Barry





On Wed, Mar 26, 2014 at 11:10 PM, Aseem Sharma <nature.aseem@gmail.com>wrote:

> I have this <https://dl.dropboxusercontent.com/u/6258283/Poly.zip> zipped
> shape files. I have plotted this using ggplot2  and gives me this
> <https://www.dropbox.com/s/ii9hl3unvgsdrh1/UlBD3.jpg>plot.
> I am looking for something like
> this<https://www.dropbox.com/s/ynkfs0m0u1q61td/UlBD4.jpg> (prepared
> using arcGIS.
> I want to change the xlabels and ylabels into equivalent longitude and
> latitude values and not Eastings and Northings, but want to be in same
> projection. Please suggest me how can i display latitude and longitude in
> place of this northings and eastings.It works when i change the projection
> of shapefile into WGS1984 but that distort the area and i do not want to do
> so. My code are
>
> library(raster)
> library(RColorBrewer)
> library(ggplot2)
> library(ncdf)
> poly<-shapefile("Test_poly.shp", stringsAsFactors=FALSE, verbose=FALSE)
> ggplot(poly) +
>   aes(long,lat,group=group, fill = id) +
>   geom_polygon() +
>   geom_path(color="white") +
>   coord_equal() +
>   scale_fill_brewer("Bydeler")
>
>  ​Your help will be appreciated.
>
> Thank you,
>
> a​
>
> ------------------
>
> "Namaste नमस्ते"
>
> Aseem Sharma
>
> Graduate Research Assistant
>
> Northern Hydrometeorology Group(NHG)
>
> Natural Resources and Environmental Studies Institute(NRESi)
>
> University of Northern British Columbia
>
> Prince George, BC, V2N 4Z9, Canada
>
> Tel: 250-960-5427
>
> Web: http://www.unbc.ca/
>
>
>  "All know the Way, but few actually walk it."
> "सबैको कल्याण होस् ।"
>
>         [[alternative HTML version deleted]]
>
>

	[[alternative HTML version deleted]]

