# Problems with bubble charts using plotly package in R

**URL:** <https://community.plotly.com/t/problems-with-bubble-charts-using-plotly-package-in-r/10719>\
**Category:** plotly.js\
**Created:** [June 6, 2018, 1:02am UTC](https://community.plotly.com/t/problems-with-bubble-charts-using-plotly-package-in-r/10719 "2018-06-06T01:02:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![souljj](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@souljj](https://community.plotly.com/u/souljj)\
**Post date:** [June 6, 2018, 1:02am UTC](https://community.plotly.com/t/problems-with-bubble-charts-using-plotly-package-in-r/10719/1 "2018-06-06T01:02:45Z")

</div>

I want to make an interactive bubble chart， I have encountered some problems in the process. Can plotly add background images? How to do? I have tried to use ggplot to add background,it’s failure. Besides, Does the edge of the bubble represent a variable parameter?

For example：width can like size which represent a range.

The following program is also problematic.when i running,it will show “Error in plot\_ly(CloudPlot\_test, x = ~RT, y = ~MZ, color = ~colors, size = ~sz, :  
could not find function “%\>%””

p \<- plot\_ly(CloudPlot\_test, x = ~RT, y = ~MZ, color = ~colors, size = ~sz,color=colors,  
type = ‘scatter’, mode = ‘markers’, sizes = c(min(CloudPlot\_test$sz), max(CloudPlot\_test$sz)),  
marker = list(symbol = ‘circle’, sizemode = ‘diameter’,  
line = list(width = 2,color = ‘#FFFFFF’)),  
text = ~features) %\>%  
layout(title = ‘Features’,  
xaxis = list(title = ‘RT’,  
gridcolor = ‘rgb(255, 255, 255)’,  
range = c(0,21 ),  
zerolinewidth = 1,  
ticklen = 5,  
gridwidth = 2),  
yaxis = list(title = ‘MZ’,  
gridcolor = ‘rgb(255, 255, 255)’,  
range = c(-800, 700),  
zerolinewidth = 1,  
ticklen = 5,  
gridwith = 2))

---

<div class="post-metadata">

**Author:** ![souljj](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@souljj](https://community.plotly.com/u/souljj)\
**Post date:** [June 6, 2018, 2:42am UTC](https://community.plotly.com/t/problems-with-bubble-charts-using-plotly-package-in-r/10719/2 "2018-06-06T02:42:50Z")

</div>

The following program is also problematic.when i running,it will show “Error in plot\_ly(CloudPlot\_test, x = ~RT, y = ~MZ, color = ~colors, size = ~sz, :  
could not find function “%\>%””

i forgot to loading plotly. i solve this problem
