Adding Polygon to existing Raster plot changes scale/extent of plot to that of new polygon

47 views
Skip to first unread message

Brad Udall

unread,
Jan 11, 2021, 2:17:09 PM1/11/21
to ggplot2

Hi,

If need be I can provide a reproducible example, but before going down that path perhaps someone could share a simple tip that would solve this for me.

I have an existing raster plot (geom_raster) of a subset of the American Southwest. I want to add state lines on top of this for context.

When I do this via geom_path of these boundary lines, my plot then gets blown up to the size/extent of the added geom_path.

So, for example, if I have a portion of AZ/CA/NM on my plot and I add state boundary lines from USA Boundaries, all of a sudden the plot shows the whole US.

There must be a simple fix for this so that the new added polygon data respects the old extent/scales etc.

Thanks,
Brad

Konstantinos L. Papageorgiou

unread,
Jan 11, 2021, 5:38:42 PM1/11/21
to ggp...@googlegroups.com

Dear Brad,
I think you are searching for https://ggplot2.tidyverse.org/reference/lims.html
Happy new year,
Kostas

--
--
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 ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ggplot2/1214f465-259c-4405-9fdc-d434d6c1d68ao%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages