# Adding markers from different data frame on Plot\_ly sf plots

**URL:** <https://community.plotly.com/t/adding-markers-from-different-data-frame-on-plot-ly-sf-plots/75332>\
**Category:** Plotly R\
**Created:** [May 17, 2023, 2:05am UTC](https://community.plotly.com/t/adding-markers-from-different-data-frame-on-plot-ly-sf-plots/75332 "2023-05-17T02:05:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jillahmad17](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jillahmad17](https://community.plotly.com/u/jillahmad17)\
**Post date:** [May 17, 2023, 2:05am UTC](https://community.plotly.com/t/adding-markers-from-different-data-frame-on-plot-ly-sf-plots/75332/1 "2023-05-17T02:05:12Z")

</div>

Hi all,

I am new here and hope I am not asking something that has been answered before; I looked and looked and could not find the answer to this.

I want to add markers from a different dataframe onto a map of North Carolina using plot\_ly. However, I am having trouble layering the markers. Here is the code I was thinking:

nc ← sf::st\_read(system.file(“shape/nc.shp”, package = “sf”), quiet = TRUE)

plot\_ly(nc) %\>%  
add\_markers(data = link2feed\_partner\_data,  
x = ~Longitutde,  
y = ~Latitude)

To get around this, I use ggplotly with a ggplot of two geom\_sf objects. However, this is quite slow in shiny and not as precise as plot\_ly.

Any suggestions?

Thank you!!

---

<div class="post-metadata">

**Author:** ![hugto\_ag](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@hugto\_ag](https://community.plotly.com/u/hugto_ag)\
**Post date:** [December 1, 2023, 10:16am UTC](https://community.plotly.com/t/adding-markers-from-different-data-frame-on-plot-ly-sf-plots/75332/2 "2023-12-01T10:16:43Z")

</div>

Did you ever found a solution for this? I’m having the same problem.

---

<div class="post-metadata">

**Author:** ![jillahmad17](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jillahmad17](https://community.plotly.com/u/jillahmad17)\
**Post date:** [December 2, 2023, 7:07pm UTC](https://community.plotly.com/t/adding-markers-from-different-data-frame-on-plot-ly-sf-plots/75332/3 "2023-12-02T19:07:33Z")

</div>

Hi so sorry for the delayed response. Yes I did, I ended up using ggplot and ggplotly instead. I am happy to post some code if that would be helpful
