# Problem with grid of plots in StatsPlots

**URL:** <https://discourse.julialang.org/t/problem-with-grid-of-plots-in-statsplots/37362>\
**Category:** General Usage\
**Created:** [April 10, 2020, 6:48pm UTC](https://discourse.julialang.org/t/problem-with-grid-of-plots-in-statsplots/37362 "2020-04-10T18:48:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [April 10, 2020, 6:48pm UTC](https://discourse.julialang.org/t/problem-with-grid-of-plots-in-statsplots/37362/1 "2020-04-10T18:48:54Z")

</div>

I encountered a problem generating a grid of plots with StatsPlots. Here is a MWE. The x and y ranges are incorrect in the 2nd and 3rd rows:

```julia
using DataFrames, StatsPlots
  title = [string("f1: ",i," ","f2: ",j) for i in 1:3 for j in 1:3]
  title = reshape(title, 1, 9)
df = DataFrame(f1=repeat(1:3,inner=5),f2=repeat(1:3,inner=5),
  z=repeat(1:3,outer=5), y=repeat(1:3,outer=5))

  @df df scatter(:z, :y, group=(:f1,:f2), xlabel="z",
    ylabel="y", xaxis=font(10), yaxis=font(10), grid=false, color=:grey,
     leg=false, size=(800,600), titlefont=font(10), title=title, layout=(3,3))

```

 ![temp](https://global.discourse-cdn.com/julialang/original/3X/7/0/7091ff04a2a1bb4c8534a87e56e167f728706c97.png)

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [April 10, 2020, 7:15pm UTC](https://discourse.julialang.org/t/problem-with-grid-of-plots-in-statsplots/37362/2 "2020-04-10T19:15:58Z")

</div>

I suspect this is a bug. Specifying `xlims=(0,3), ylims=(0,3)` fixes the axes but no data are displayed.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [April 10, 2020, 7:20pm UTC](https://discourse.julialang.org/t/problem-with-grid-of-plots-in-statsplots/37362/3 "2020-04-10T19:20:29Z")

</div>

For reference: [Scatter plot does not work with group · Issue #328 · JuliaPlots/StatsPlots.jl · GitHub](https://github.com/JuliaPlots/StatsPlots.jl/issues/328)
