How to draw Gantt chart using Plots


I want to draw Gantt chart (someone told it broken bar chart) to represent a task timeline like below.
But I cannot find any information how to draw this chart using Plots.

Is there any way to draw this kind of chart using Plots?

Did you try the search bar: Search results for 'gantt' - JuliaLang

1 Like

Take a look at VegaLite.jl, and the bar chart examples, it might be possible to do it that way:

There seem to be even an example:

Thank you for your replies!

Of course, I tried and see your solution using Gadfly. :slight_smile:
I just wondered there is another way to draw this using Plots.

This VegaLite looks good!

I first wanted to use Plots because it has many backend supports, but maybe I should switch to other packages.

Unfortunately Gadfly is not working with Julia 1.0 right now.
VegaLite works nicely with Julia 1.0, though.

using VegaLite

            scale={range=["#EA98D2", "#659CCA", "#000000"]}


By the way, could you tell me why Plots dropped Gadfly backend support?

1 Like

For Gadfly vs Plots see here :slight_smile:

There’s a PR here for Julia 1.0 support, should be merged soon.

Actually on that link I can read “I will leave the history of Gadfly vs Plots for others to explain!”… so really it’s a bit frustrating to see so many plotting packages instead of a well-established “reference” one, like ggplot2 in R or matplotlib in python…

I disagree - the approaches taken by Plots, VegaLite and gadfly are all quite different. I prefer Plots, but others prefer the others. Im often annoyed going back to R because I find ggplot unintuitive and have to Google anytime I want to do anything. But other people really like it.

Why would it be better to force everyone into the same way of doing things?


Here is a slightly more concise version for VegaLite.jl:

using VegaLite, DataFrames

df = DataFrame(worker=[1,2,3,2], start=[1,2,3,7], stop=[3,6,7,9], type=["A","B","B","C"])

df |> @vlplot(
    color={:type, scale={range=["#EA98D2", "#659CCA", "#000000"]}}
1 Like