# Hatched fill with Plots and GR

**URL:** https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640
**Category:** General Usage
**Tags:** plots, gr, statsplots
**Created:** [July 24, 2020, 9:29pm UTC](https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640 "2020-07-24T21:29:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Tominapa](https://avatars.discourse-cdn.com/v4/letter/t/cab0a1/32.png) [@Tominapa](https://discourse.julialang.org/u/Tominapa)
#### Post date: [July 24, 2020, 9:29pm UTC](https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640/1 "2020-07-24T21:29:56Z")

</div>

I am working with a grouped bar graph with plots (and statsplots for the groupedbar() type) using GR as the backend. Here is an example of the type of graph I’m working with:

```julia
using Plots
using StatsPlots
using Colors

m = 4
n = 2

data = rand(n,m)
legend = ["this" "that" "the other" "those"]
fillcolor = [:green :blue :lightgreen :lightblue]
xcats = collect(1:n)

plt = groupedbar(data, xticks=(1:n, xcats), bar_position=:stack,
        bar_width=0.7,
        fill=(0,fillcolor),
        xlabel="x axis",
        ylabel="y axis",
        formatter=:plain,
        label=legend,
        legend=true)

```

This issue I am having is that I would like to be able to use a hatched fill on some of the stacked bars. In the example, say I would like to have hatched fill for “the other” and “those” categories, but a solid fill for “this” and “that.”

I have been reading through the plots documentation, the statsplots documentation, and the GR documentation. As best as I can tell, GR has the capability, but there isn’t an obvious plots option to get hatched fills.

Would anyone know how to do this?

Thank you.

---

<div class="post-metadata">

### Author: ![pearlzli](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@pearlzli](https://discourse.julialang.org/u/pearlzli)
#### Post date: [October 28, 2020, 6:03am UTC](https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640/2 "2020-10-28T06:03:39Z")

</div>

I was also looking for this feature! I opened a (very first-stabby) [pull request](https://github.com/JuliaPlots/Plots.jl/pull/3107) on Plots.jl implementing hatched fill in GR and PyPlot.

---

<div class="post-metadata">

### Author: ![Tominapa](https://avatars.discourse-cdn.com/v4/letter/t/cab0a1/32.png) [@Tominapa](https://discourse.julialang.org/u/Tominapa)
#### Post date: [June 10, 2021, 3:54pm UTC](https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640/3 "2021-06-10T15:54:34Z")

</div>

Thanks for taking the initiative to add this feature!

---

<div class="post-metadata">

### Author: ![hannaekfalth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hannaekfalth/32/22047_2.png) [@hannaekfalth](https://discourse.julialang.org/u/hannaekfalth)
#### Post date: [January 18, 2022, 10:12am UTC](https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640/4 "2022-01-18T10:12:10Z")

</div>

Thanks! Do you know if this is also implemented in the Plotly backend in Plots.jl somehow?

---

<div class="post-metadata">

### Author: ![hdavid16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hdavid16/32/11531_2.png) [@hdavid16](https://discourse.julialang.org/u/hdavid16)
#### Post date: [January 27, 2023, 5:14pm UTC](https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640/5 "2023-01-27T17:14:08Z")

</div>

BeautifulMakie has this feature! [Stripped barplots - Beautiful Makie](https://beautiful.makie.org/dev/examples/generated/2d/bars/stripped_bars/)
