0

I know there are already at least two threads on this topic from several years ago, but I wonder if there have been any changes over the years that make new answers possible?:

The question is: is it finally possible to make a facetted plot with free scale (to zoom on each single element) keeping axis-ratio fixed (in my case using coord_quickmap)?

Both these threads don't answers the question, or they just suggest using tmap instead of ggplot... But the point is: is there a way to go on with ggpot?

I tried two different ways to go on:

  1. keeping aspect ratio but unable to zoom on each feature
lomb_prov <- read.csv("lomb_prov.csv")

ggplot(lomb_prov, aes(x = x, y = y)) +
  geom_tile(fill = "light grey") +
  facet_wrap(~ provincia) +
  coord_quickmap()

enter image description here

  1. setting scales = "free I'm able to zoom to each feature in facets but aspect ratio is lost
ggplot(lomb_prov, aes(x = x, y = y)) +
  geom_tile(fill = "light grey") +
  facet_wrap(~ provincia, scales = "free") +
  coord_quickmap()

enter image description here

The outcame i would like to achive is to keep aspect ratio (like first plot) and zoom on each single province (like second plot). So, anyone is able to suggest a way to combine both?

Waiting for kind suggestions, thank you!

ATTACHED FILE: https://drive.google.com/file/d/12bN8y22-AY2prsFq4VEHcdbqKZ6z4XEL/view?usp=sharing

emaoca
  • 47
  • 3
  • 1
    You may have to manually compute limits for each facet panel that correspond to your desired aspect ratio. But defining limits for individual facet panels isn’t straightforward either — see [this question](https://stackoverflow.com/q/51735481/17303805) for some approaches. – zephryl Aug 11 '22 at 13:32
  • And of course the other approach is to make the panels independently with the desired scales and aspect ratios and then arrange them as above using packages like `cowplot` or `egg`. You'll probably have to think about which less-than-ideal solution is easiest for your situation. – phalteman Aug 11 '22 at 20:09

0 Answers0