Striped Colors for e.g. bar plots in Julia

This is an image of a figure a friend made (in matlab), would it be possible to create a similar effect in Julia where the colour is striped (instead of monocolour)?
(in this case the stipes helps show that the 4th bar is a combination of the 2nd and 3rd)

One option using PyPlot:

using PyPlot
plt.rc("hatch", lw=4.0), 1:3, color=["grey","green","orange"], edgecolor="black")[4], [4], color="orange", edgecolor="green", hatch=["//"])[4], [4], color="none", edgecolor="black")



In Makie:

using Makie, GLMakie
p = Makie.LinePattern(width=10, tilesize=(30,30), linecolor=:orange, background_color=:green);
barplot(1:3,strokewidth=2, color=["grey","green","orange"])
barplot!([4], [4], color=p, strokewidth=2)


This is great, thank’s both of you!
(is there a way to mark two answers as solutions?)

1 Like

Please mark Makie as solution.

this seems to simply give me an output

Combined{Makie.barplot, Tuple{Vector{Point{2, Float32}}}}

in Jupyter (as in that text instead of an image). Meanwhile scratching the last line (barplot!([4], [4], color=p, strokewidth=2)) I get a proper display (however without the last bar). Am I missing something obvious here?

Am I missing something obvious here?

Yes :wink:

This should become clear when using the more explicit, non magic version:

figure, axis, plotobject1 = barplot(1:3,strokewidth=2, color=["grey","green","orange"])
plotobject2  = barplot!(axis, [4], [4], color=p, strokewidth=2)

The return value of plot!(...) is a plot object, which doesn’t display by default…


So pretty it is

Thanks a lot. Makie seems to be the cool stuff these days, maybe this is the signal I should finally go learn it properly…