# Geom\_sf with plotly

**URL:** <https://community.plotly.com/t/geom-sf-with-plotly/17174>\
**Category:** Plotly R\
**Created:** [December 20, 2018, 6:41pm UTC](https://community.plotly.com/t/geom-sf-with-plotly/17174 "2018-12-20T18:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymack](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@cymack](https://community.plotly.com/u/cymack)\
**Post date:** [December 20, 2018, 6:42pm UTC](https://community.plotly.com/t/geom-sf-with-plotly/17174/1 "2018-12-20T18:42:00Z")

</div>

I can’t render plotly versions of maps made using ggplot2 with geom\_sf. Other geoms work fine with plotly in my hands, e.g. bar charts, boxplots, and even geolocated points with custom hover labels. Even the simple example from one of Sievert’s articles does not work:

```auto
library(ggplot2)
library(plotly)
library(sf)
library(albersusa)

us_laea <- usa_sf("laea")
p <- ggplot() + geom_sf(data = us_laea)
ggplotly(p)

```

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![arthurwelle](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@arthurwelle](https://community.plotly.com/u/arthurwelle)\
**Post date:** [September 18, 2019, 2:02pm UTC](https://community.plotly.com/t/geom-sf-with-plotly/17174/2 "2019-09-18T14:02:46Z")

</div>

Same problem here. Did you get around it?

Tracebak:  
Error: object of type ‘closure’ is not subsettable  
5. aes2plotly(data, params, “size”)  
4. geom2trace.GeomPath(d, params)  
3. gg2list(p, width = width, height = height, tooltip = tooltip, dynamicTicks = dynamicTicks, layerData = layerData, originalData = originalData, source = source, …)  
2. ggplotly.ggplot§

1. plotly::ggplotly§

The article for reference: [https://moderndata.plot.ly/learning-from-and-improving-upon-ggplotly-conversions/](https://moderndata.plot.ly/learning-from-and-improving-upon-ggplotly-conversions/)

---

<div class="post-metadata">

**Author:** ![arthurwelle](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@arthurwelle](https://community.plotly.com/u/arthurwelle)\
**Post date:** [September 18, 2019, 2:28pm UTC](https://community.plotly.com/t/geom-sf-with-plotly/17174/3 "2019-09-18T14:28:45Z")

</div>

Solved it by updating plotly::
