# R plotly subplot using more than 20 plots?

**URL:** <https://community.plotly.com/t/r-plotly-subplot-using-more-than-20-plots/10385>\
**Category:** Plotly R\
**Created:** [May 18, 2018, 8:19pm UTC](https://community.plotly.com/t/r-plotly-subplot-using-more-than-20-plots/10385 "2018-05-18T20:19:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffljx12](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jeffljx12](https://community.plotly.com/u/jeffljx12)\
**Post date:** [May 18, 2018, 8:19pm UTC](https://community.plotly.com/t/r-plotly-subplot-using-more-than-20-plots/10385/1 "2018-05-18T20:19:59Z")

</div>

I tried to create a subplot with big numbers. A simplified example: the following code which creates 19 empty plots works fine.

> plotList ← function(nplots) {lapply(seq\_len(nplots), function(x) plot\_ly())}  
> subplot(plotList(19), nrows = 19, shareX = TRUE, shareY = TRUE)

 ![19](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/8/8ba2c5608824271220204b30de026cf926002ab2.jpg)

However, it goes wrong if the number of plots exceeds 20.

> subplot(plotList(21), nrows = 21, shareX = TRUE, shareY = TRUE)

 ![21](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/3/395403c1cfaf5e0b01881db6764194c9e71f4f28.jpg)

Is there a way to solve it?
