# PGFPlotsX.jl boxplot

**URL:** <https://discourse.julialang.org/t/pgfplotsx-jl-boxplot/93047>\
**Category:** General Usage\
**Tags:** plotting, pgfplotsx\
**Created:** [January 16, 2023, 8:40pm UTC](https://discourse.julialang.org/t/pgfplotsx-jl-boxplot/93047 "2023-01-16T20:40:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipelle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fipelle/32/4772_2.png) [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Post date:** [January 16, 2023, 8:40pm UTC](https://discourse.julialang.org/t/pgfplotsx-jl-boxplot/93047/1 "2023-01-16T20:40:41Z")

</div>

Hi,

I was wondering if there is a way to get overlay a line chart on top of a boxplot in PGFPlotsX.jl (something like [this](https://stackoverflow.com/questions/66224343/how-to-overlay-a-boxplot-and-a-lineplot)). Has anyone tried that before?

---

<div class="post-metadata">

**Author:** ![annoporci](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@annoporci](https://discourse.julialang.org/u/annoporci)\
**Post date:** [January 17, 2023, 8:24am UTC](https://discourse.julialang.org/t/pgfplotsx-jl-boxplot/93047/2 "2023-01-17T08:24:46Z")

</div>

You just need to extract the median from your data and overlay. I’ve seen this sort of plot before, but I’m not convinced it looks good. It’s a matter of taste, so you’ll have to decide what works best, but once you’ve extracted the medians you could also make two separate plots.

Edit: This is obvious, but for the line to “make sense” your categories must have a metric, like the years in time series data, but it would make “little sense” if the categories were, say, ages 18-25, 25-35, 35-55, 55+.
