mapPies doesn't draw size legend. Please help.

126 views
Skip to first unread message

Hoàng Nguyễn

unread,
Dec 2, 2015, 3:42:52 AM12/2/15
to rworldmap
Hello,

I am trying to plot pie charts over world map and I found rworldmap package is really useful with simple syntax and input. I managed to make such a plot,however when i used addSizeLegend=TRUE, no legend appeared. I tried with R 3.2.2 64 bit and R 3.0.2 32 bit on Windows 7 64 bit- R Studio 0.99.489 and the newest rwolrdmap on CRAN but no lucks. Besides, the pie's border is not as smooth as i saw in manual file.
Here is an example of what i have done:

LAT<-c(-21.91674,50.50389)
LON<-c(132.73438,4.46994)
a<-c(300,400)
b<-c(500,600)
dF<-data.frame(LAT,LON,a,b)
mapPies(dF=dF, nameX="LON", nameY="LAT", nameZs=c("a","b"),zColours=c("red","green"),oceanCol="lightblue",landCol="white",mapRegion="world", symbolSize=0.7, addSizeLegend = TRUE)

Could you please show me a way to fix it?

Best regards,
Hoang

P/s: Do you have any plan to include bar charts (not stackd one) in mapBars?
Rplot01.jpeg

Andy South

unread,
Dec 2, 2015, 4:53:24 PM12/2/15
to Hoàng Nguyễn, rworldmap
Dear Hoang,

Unfortunately there isn't an easy way to get the size legend working at the moment. I disabled it because it didn't always fit on the plot. I should have amended the documentation to reflect that, apologies I will do it in the next release.

No plans for bar charts either sorry. I don't get any financial support to keep rworldmap going so it's difficult to spend much time on it.
There is a potential ggplot solution in the link below, but posts on stackoverflow seem to suggest that this may not work currently either.

You mentioned a non-smooth pie border in your jpg, if you save your image as a pdf (or other vector format) you should get a smoother circle.

Best wishes,
Andy  
 

--
You received this message because you are subscribed to the Google Groups "rworldmap" group.
To post to this group, send email to rwor...@googlegroups.com.
Visit this group at http://groups.google.com/group/rworldmap.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rworldmap/a5e45a41-3561-4236-b3e6-af050813c2ca%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages