# \#statsplots

**URL:** https://discourse.julialang.org/tag/statsplots/402.md?match_all_tags=true&page=1&tags%5B%5D=statsplots

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 2

---

## [Disabling grouping along x-axis in grouped boxplot](https://discourse.julialang.org/t/disabling-grouping-along-x-axis-in-grouped-boxplot/93997)

<div class="topic-metadata">

**Author:** [@jewh](https://discourse.julialang.org/u/jewh)\
**Replies:** 1\
**Last updated:** [February 3, 2023, 10:59pm UTC](https://discourse.julialang.org/t/disabling-grouping-along-x-axis-in-grouped-boxplot/93997 "2023-02-03T22:59:29Z")

</div>

Using the group keyword argument in Statsplots.boxplot adjusts the distance between individual boxes so that they cluster with their groups (see example below): using StatsPlots x = Vector{String}(undef, 40) for i = 1…

---

## [Hatched fill with Plots and GR](https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640)

<div class="topic-metadata">

**Author:** [@Tominapa](https://discourse.julialang.org/u/Tominapa)\
**Replies:** 4\
**Last updated:** [January 27, 2023, 5:14pm UTC](https://discourse.julialang.org/t/hatched-fill-with-plots-and-gr/43640 "2023-01-27T17:14:08Z")

</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: using Plots using StatsPlots using Colors m…

---

## [Ignore, please (uninformed question)](https://discourse.julialang.org/t/ignore-please-uninformed-question/93390)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 1\
**Last updated:** [January 23, 2023, 10:32am UTC](https://discourse.julialang.org/t/ignore-please-uninformed-question/93390 "2023-01-23T10:32:28Z")

</div>

In the course of preparing materials to explain boxplots to students, I am seeing something odd with the whiskers in a boxplot. The code ## example box X = randn(100) M = median(X) Q1 = quantile(X,0.25) Q3 = quantile(X,…

---

## [How to produce nice boxplots](https://discourse.julialang.org/t/how-to-produce-nice-boxplots/9345)

<div class="topic-metadata">

**Author:** [@burfel](https://discourse.julialang.org/u/burfel)\
**Replies:** 12\
**Last updated:** [November 12, 2022, 10:03am UTC](https://discourse.julialang.org/t/how-to-produce-nice-boxplots/9345 "2022-11-12T10:03:56Z")

</div>

Does anyone know how to produce nice boxplots out of a dataframe of this form? │ Row │ Smarcc1 │ Socs3 │ Sox1 │ Sox2 │ Stat3 │ T │ Tbx3 │ Tcf7l1 │ ├─────┼─────────┼─────────┼──────┼─────────┼─────────┼─────…

---

## [Groupedbar, groupedhist, StatPlots, StatsPlots?](https://discourse.julialang.org/t/groupedbar-groupedhist-statplots-statsplots/89071)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 7\
**Last updated:** [October 24, 2022, 8:35am UTC](https://discourse.julialang.org/t/groupedbar-groupedhist-statplots-statsplots/89071 "2022-10-24T08:35:15Z")

</div>

So, what function in what package is best for a bar chart with multiple datasets? So far I’ve been looking at the StatPlots and StatsPlots packages and groupedbar and groupedhist. I’m not able to install the former pac…

---

## [Plots.jl annotation with group colours in grouped plot](https://discourse.julialang.org/t/plots-jl-annotation-with-group-colours-in-grouped-plot/88979)

<div class="topic-metadata">

**Author:** [@klwlevy](https://discourse.julialang.org/u/klwlevy)\
**Replies:** 5\
**Last updated:** [October 20, 2022, 3:56pm UTC](https://discourse.julialang.org/t/plots-jl-annotation-with-group-colours-in-grouped-plot/88979 "2022-10-20T15:56:25Z")

</div>

Dear Plots.jl wizards, could someone give me advice how to best get annotations in the same colour as the lines when using the group option? The following is a working example: using DataFrames, Plots gr(size=(1200, 8…

---

## [How to make this plot in Julia?](https://discourse.julialang.org/t/how-to-make-this-plot-in-julia/75065)

<div class="topic-metadata">

**Author:** [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Replies:** 29\
**Last updated:** [October 17, 2022, 8:15pm UTC](https://discourse.julialang.org/t/how-to-make-this-plot-in-julia/75065 "2022-10-17T20:15:54Z")

</div>

How do I make something similar to the following plot in Julia? using RCall, DataFrames, Random Random.seed!(123) d = DataFrame(name = repeat(\["A","B","C","D","E","F"\], inner=4), time=repeat(\[0,1,3,6\], outer=6), …

---

## [Plotting with independent series](https://discourse.julialang.org/t/plotting-with-independent-series/86576)

<div class="topic-metadata">

**Author:** [@catzilla](https://discourse.julialang.org/u/catzilla)\
**Replies:** 3\
**Last updated:** [August 31, 2022, 9:46am UTC](https://discourse.julialang.org/t/plotting-with-independent-series/86576 "2022-08-31T09:46:06Z")

</div>

How do you modify series attributes independently? For example, to plot data \[x,y, color, shape\], I would like to plot in 2D, with each data point given its corresponding color and shape. I have tried @df df scatter(:…

---

## [StatPlots groupedbar order x axis](https://discourse.julialang.org/t/statplots-groupedbar-order-x-axis/13912)

<div class="topic-metadata">

**Author:** [@stelmo](https://discourse.julialang.org/u/stelmo)\
**Replies:** 18\
**Last updated:** [August 30, 2022, 10:00pm UTC](https://discourse.julialang.org/t/statplots-groupedbar-order-x-axis/13912 "2022-08-30T22:00:05Z")

</div>

Hi, Is there a way to order the x-axis bars using groupedbar? Currently it is placing the individual bars alphabetically, but I would like to specify the order manually. I have tried using plot!(xticks=(1:10, labels)), …

---

## [Is there a way to hide the boxplots names on the x axis?](https://discourse.julialang.org/t/is-there-a-way-to-hide-the-boxplots-names-on-the-x-axis/86223)

<div class="topic-metadata">

**Author:** [@Juan\_Mac\_Donagh](https://discourse.julialang.org/u/Juan_Mac_Donagh)\
**Replies:** 3\
**Last updated:** [August 24, 2022, 1:09am UTC](https://discourse.julialang.org/t/is-there-a-way-to-hide-the-boxplots-names-on-the-x-axis/86223 "2022-08-24T01:09:00Z")

</div>

Hi, I was wondering if there was a way to hide the names of each boxplots using StatsPlots grouped boxplots. I looked into both Plots and StatsPlots documentation, but I couldn’t find an argument atribute for it. Here’s…

---

## [Create Groupedbar in Statsplot from Dataframe with dates on the x-axis](https://discourse.julialang.org/t/create-groupedbar-in-statsplot-from-dataframe-with-dates-on-the-x-axis/84108)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 12\
**Last updated:** [July 14, 2022, 2:09pm UTC](https://discourse.julialang.org/t/create-groupedbar-in-statsplot-from-dataframe-with-dates-on-the-x-axis/84108 "2022-07-14T14:09:04Z")

</div>

Hi all, I want to plot this csv: To become a groupedbar like this: With dates on the x-axis (do I need to change the format in the csv of 01.2015 / 02.2015?) I want to plot an entire column (e.g. Solar) and plo…

---

## [Plot from DataFrames using StatsPlots](https://discourse.julialang.org/t/plot-from-dataframes-using-statsplots/83991)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [July 9, 2022, 5:56pm UTC](https://discourse.julialang.org/t/plot-from-dataframes-using-statsplots/83991 "2022-07-09T17:56:53Z")

</div>

Hi all, I just learn about using csv and create dataframe. This is my code: using CSV using DataFrames df = CSV.read("/home/browni/LasthrimProjection/importedenergydata.csv", DataFrame) print(df) Now, I want to pl…

---

## [Small-multiples plots in Plots.jl](https://discourse.julialang.org/t/small-multiples-plots-in-plots-jl/83529)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 2\
**Last updated:** [June 29, 2022, 8:21pm UTC](https://discourse.julialang.org/t/small-multiples-plots-in-plots-jl/83529 "2022-06-29T20:21:13Z")

</div>

I have time series for each state in the US. I have grouped the states by a geographic grouping factor. There are 8 state groups. I’d like to make 8 panels, one for each state group, within the panel I want each state t…

---

## [Question about plot?](https://discourse.julialang.org/t/question-about-plot/83336)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 3\
**Last updated:** [June 25, 2022, 5:24pm UTC](https://discourse.julialang.org/t/question-about-plot/83336 "2022-06-25T17:24:37Z")

</div>

Dear all, How to fill color between (2, 3) in the graph below? julia\> using Distributions julia\> plot(Normal(0, 1))

---

## [How to make this graph more beautiful?](https://discourse.julialang.org/t/how-to-make-this-graph-more-beautiful/82912)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 7\
**Last updated:** [June 18, 2022, 6:40am UTC](https://discourse.julialang.org/t/how-to-make-this-graph-more-beautiful/82912 "2022-06-18T06:40:55Z")

</div>

Dear all, I want to add annotations in scatter plot. But the annotations are very large, how to make it smaller and beautiful? julia\> using DataFrames, RDatasets, Plots julia\> df = dataset("datasets", "iris"); julia\> …

---

## [Statsplots dendrogram - how to have clustered coloring](https://discourse.julialang.org/t/statsplots-dendrogram-how-to-have-clustered-coloring/50768)

<div class="topic-metadata">

**Author:** [@alailink](https://discourse.julialang.org/u/alailink)\
**Replies:** 12\
**Last updated:** [June 8, 2022, 2:32pm UTC](https://discourse.julialang.org/t/statsplots-dendrogram-how-to-have-clustered-coloring/50768 "2022-06-08T14:32:13Z")

</div>

I’m new to Julia, but already impressed by it’s syntax and by statsplots. However, some functionality is still missing that I miss from Python/R. Specifically for this post, I would like to color-code the output of clus…

---

## [Unable to get a normalized density plot!](https://discourse.julialang.org/t/unable-to-get-a-normalized-density-plot/81251)

<div class="topic-metadata">

**Author:** [@devanshu](https://discourse.julialang.org/u/devanshu)\
**Replies:** 8\
**Last updated:** [May 18, 2022, 11:47am UTC](https://discourse.julialang.org/t/unable-to-get-a-normalized-density-plot/81251 "2022-05-18T11:47:44Z")

</div>

Hi, I am trying to get the density plot of a data set. I am using the StatsPlots package for this. My code looks like this density(data, fill=(0, 0.5), normalize=true). But I still don’t get a normalized plot. I wonde…

---

## [Stacked bars for different length](https://discourse.julialang.org/t/stacked-bars-for-different-length/80577)

<div class="topic-metadata">

**Author:** [@Aminath\_Shausan](https://discourse.julialang.org/u/Aminath_Shausan)\
**Replies:** 2\
**Last updated:** [May 6, 2022, 12:07pm UTC](https://discourse.julialang.org/t/stacked-bars-for-different-length/80577 "2022-05-06T12:07:08Z")

</div>

Hi, I am trying to plot stacked bar graphs from the following data frame: name duration label String3 Int64 SubStri… 1 AUS 31 1 2 AUS 89 2 3 AUS 133 3 4 GBR 86 1 5 GBR 88 …

---

## [A few questions about my workflow for quickly investigating data!](https://discourse.julialang.org/t/a-few-questions-about-my-workflow-for-quickly-investigating-data/78913)

<div class="topic-metadata">

**Author:** [@charperflow](https://discourse.julialang.org/u/charperflow)\
**Replies:** 10\
**Last updated:** [April 3, 2022, 10:47am UTC](https://discourse.julialang.org/t/a-few-questions-about-my-workflow-for-quickly-investigating-data/78913 "2022-04-03T10:47:12Z")

</div>

I am taking an upper level stats course taught in r. I have been doing a duplicate of the assignments in Julia, which has been a lot of fun. However, I have come across a few sticking points. I’ll just stick to one in th…

---

## [What is the better way to make a countplot?](https://discourse.julialang.org/t/what-is-the-better-way-to-make-a-countplot/78364)

<div class="topic-metadata">

**Author:** [@folleyz](https://discourse.julialang.org/u/folleyz)\
**Replies:** 4\
**Last updated:** [March 24, 2022, 11:10am UTC](https://discourse.julialang.org/t/what-is-the-better-way-to-make-a-countplot/78364 "2022-03-24T11:10:58Z")

</div>

Hi everybody! I’m trying to make a countplot with StatsPlots, and i’m using the code below, that works, but i want to know if have a simplest or clever way to achieve this. begin @df df Plots.bar(unique(df.Gender), \[c…

---

## [How to plot histogram subplots of a DataFrame?](https://discourse.julialang.org/t/how-to-plot-histogram-subplots-of-a-dataframe/78355)

<div class="topic-metadata">

**Author:** [@folleyz](https://discourse.julialang.org/u/folleyz)\
**Replies:** 11\
**Last updated:** [March 23, 2022, 11:40pm UTC](https://discourse.julialang.org/t/how-to-plot-histogram-subplots-of-a-dataframe/78355 "2022-03-23T23:40:54Z")

</div>

Hello Everybody! I have a question, i’m refatoring my old python projects to Julia and i have a doubt in a situation. Looks how i plot using python matplotlib: df.hist(figsize=(12,10)); And now using Julia StatsP…

---

## [Common legend for subplots](https://discourse.julialang.org/t/common-legend-for-subplots/78079)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [March 20, 2022, 7:30pm UTC](https://discourse.julialang.org/t/common-legend-for-subplots/78079 "2022-03-20T19:30:30Z")

</div>

Hi all, I have a follow up question to this ongoing issue about using a common legend across subplots. In my use case, a vector of plots with an unknown length are combined into a grid of subplots. Subplots do not nece…

---

## [Y-axis scale in histogram](https://discourse.julialang.org/t/y-axis-scale-in-histogram/76819)

<div class="topic-metadata">

**Author:** [@met-j](https://discourse.julialang.org/u/met-j)\
**Replies:** 3\
**Last updated:** [February 20, 2022, 9:44pm UTC](https://discourse.julialang.org/t/y-axis-scale-in-histogram/76819 "2022-02-20T21:44:13Z")

</div>

How can I scale the y axis ticks in a histogram? Is there a way to access the counts in a histogram from dispatching the plot function with st=:hist? In my case I have counts in between 1 000 and a few 10 000s. I woul…

---

## [StatsPlots & DataFrames: grouping by multiple columns](https://discourse.julialang.org/t/statsplots-dataframes-grouping-by-multiple-columns/76364)

<div class="topic-metadata">

**Author:** [@Cingulate7](https://discourse.julialang.org/u/Cingulate7)\
**Replies:** 4\
**Last updated:** [February 17, 2022, 4:33pm UTC](https://discourse.julialang.org/t/statsplots-dataframes-grouping-by-multiple-columns/76364 "2022-02-17T16:33:51Z")

</div>

I want to create a box plot of data in a DataFrame grouped by more than one variable (column value). Is there a compact high-level way to do this? The following does not work: ‘’'using DataFrames, StatsPlots dfa = Data…

---

## [Stacked bar graphs](https://discourse.julialang.org/t/stacked-bar-graphs/18550)

<div class="topic-metadata">

**Author:** [@svpillai](https://discourse.julialang.org/u/svpillai)\
**Replies:** 24\
**Last updated:** [February 14, 2022, 11:29am UTC](https://discourse.julialang.org/t/stacked-bar-graphs/18550 "2022-02-14T11:29:49Z")

</div>

Hello all, I’m quite new to Julia and was a bit lost on how to create Stacked Bar graphs. I’d like to have ideally 8 bars, grouped in pairs. Each of these bars would have 5 stacks that add up to a 100%- this is basically…

---

## [Categorical histogram](https://discourse.julialang.org/t/categorical-histogram/76323)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 0\
**Last updated:** [February 13, 2022, 12:32am UTC](https://discourse.julialang.org/t/categorical-histogram/76323 "2022-02-13T00:32:19Z")

</div>

How can I set the order of the groups? Julia tends to reshuffle them randomly. And how can I add a second row with a bracket and its own name to show that G1 and G2 are part of a subgroup called Gprime? ctg = repeat(\["C…

---

## [Asymmetric error bars and box plots in Julia](https://discourse.julialang.org/t/asymmetric-error-bars-and-box-plots-in-julia/73647)

<div class="topic-metadata">

**Author:** [@newtothis](https://discourse.julialang.org/u/newtothis)\
**Replies:** 3\
**Last updated:** [January 22, 2022, 6:56pm UTC](https://discourse.julialang.org/t/asymmetric-error-bars-and-box-plots-in-julia/73647 "2022-01-22T18:56:41Z")

</div>

I have a Julia program that gives me data in the following form. For each point on X, I get a vector for the Y axis. I want to plot a boxplot for each X value using the vector of Y values. So I want the median to be the …

---

## [Plots color based on discrete value](https://discourse.julialang.org/t/plots-color-based-on-discrete-value/72472)

<div class="topic-metadata">

**Author:** [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Replies:** 4\
**Last updated:** [January 18, 2022, 10:40am UTC](https://discourse.julialang.org/t/plots-color-based-on-discrete-value/72472 "2022-01-18T10:40:38Z")

</div>

data = DataFrame(x=1:5,y=1:5,color=\["a","a","b","a","c"\]) using StatsPlots @df data scatter(:x,:y) How can add color to the plot using the discrete value of column :color automatically? In ggplot I can do something lik…

---

## [Normal probability plot](https://discourse.julialang.org/t/normal-probability-plot/74663)

<div class="topic-metadata">

**Author:** [@iskyd](https://discourse.julialang.org/u/iskyd)\
**Replies:** 7\
**Last updated:** [January 16, 2022, 12:54am UTC](https://discourse.julialang.org/t/normal-probability-plot/74663 "2022-01-16T00:54:36Z")

</div>

I have a dataframe that contains SalePrice and I’m trying to plot the normal distribution and the normal probability plot. To plot the distribution I’m using Plots jl and StatsPlot and doing something like histogram(tr…

---

## [Annotations in groupedbar are broken?](https://discourse.julialang.org/t/annotations-in-groupedbar-are-broken/74418)

<div class="topic-metadata">

**Author:** [@alfaromartino](https://discourse.julialang.org/u/alfaromartino)\
**Replies:** 1\
**Last updated:** [January 15, 2022, 2:56pm UTC](https://discourse.julialang.org/t/annotations-in-groupedbar-are-broken/74418 "2022-01-15T14:56:15Z")

</div>

I tried to add some numbers to each bar in groupedbar of StatsPlots and it always repeats the numbers of the first group. The error was reproduced in pgfplotsx, pyplot, and plotly as backends. MWE: x=\["A","A","B","B"\] …

[Previous page](https://discourse.julialang.org/tag/statsplots/402.md?match_all_tags=true&tags%5B%5D=statsplots)

[Next page](https://discourse.julialang.org/tag/statsplots/402.md?match_all_tags=true&page=2&tags%5B%5D=statsplots)
