Discussion:
manually add a legend to the Map
Ava Olsen
2018-05-29 21:15:20 UTC
Permalink
Hi everyone,

I created a Midwest map and wanted to add a little right triangles
representing clinics to the map by the code below

Midwest + geom_point(data=clinics, aes(x=lon, y=lat, group=group), size =
2, show.legend = F)

I wanted to manually create a legend to show that a little red triangle
representing clinics.

Tried to reconstruct the data by adding variables like shape = 24 to the
'clinics' dataset and run the code like this

hosp + geom_point(data=clinics, aes(x=lon, y=lat, group=group,
shape=shape), size = 2, show.legend = T)

but get an error message saying 'Error: Continuous value supplied to
discrete scale '

Any help will be appreciated! thanks, Ava
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...