# \#statsplots

**URL:** https://discourse.julialang.org/tag/statsplots/402.md?page=2

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

**Page:** 3

---

## [Plots / GR cutting off y axis labels / needs more padding](https://discourse.julialang.org/t/plots-gr-cutting-off-y-axis-labels-needs-more-padding/73778)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 3\
**Last updated:** [December 30, 2021, 2:26am UTC](https://discourse.julialang.org/t/plots-gr-cutting-off-y-axis-labels-needs-more-padding/73778 "2021-12-30T02:26:53Z")

</div>

I’m plotting some data with StatsPlots and using savefig and winding up with something like this: On the lower plot the y axis label is “Mbps” but it doesn’t show up because it’s “off the screen” can anyone tell me h…

---

## [(boxplot, StatsPlots.jl) how to plot \`boxplot\` with different number of data for each label?](https://discourse.julialang.org/t/boxplot-statsplots-jl-how-to-plot-boxplot-with-different-number-of-data-for-each-label/72649)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 1\
**Last updated:** [December 6, 2021, 11:43am UTC](https://discourse.julialang.org/t/boxplot-statsplots-jl-how-to-plot-boxplot-with-different-number-of-data-for-each-label/72649 "2021-12-06T11:43:03Z")

</div>

Hi, I’d like to plot a boxplot with different number of data for each label. For example, using StatsPlots labels = \["hi", "hello"\] data = \[1.0 missing 3.0; 4.0 5.0 6.0\] boxplot(labels, data) results in the error: j…

---

## [Plot a diagonal 1:1 line in a marginalkde plot](https://discourse.julialang.org/t/plot-a-diagonal-1-1-line-in-a-marginalkde-plot/72036)

<div class="topic-metadata">

**Author:** [@rio](https://discourse.julialang.org/u/rio)\
**Replies:** 3\
**Last updated:** [November 25, 2021, 9:34am UTC](https://discourse.julialang.org/t/plot-a-diagonal-1-1-line-in-a-marginalkde-plot/72036 "2021-11-25T09:34:24Z")

</div>

Hi, I am trying to add a diagonal 1:1 line to a marginalkde plot. I found that there is Plots.abline! which draws a straight line in the form of ax+b respecting axis limits of the plot. However, my attempt below draws t…

---

## [Hatch or groupfill in groupedbar stats plots](https://discourse.julialang.org/t/hatch-or-groupfill-in-groupedbar-stats-plots/71824)

<div class="topic-metadata">

**Author:** [@grandemundo82](https://discourse.julialang.org/u/grandemundo82)\
**Replies:** 0\
**Last updated:** [November 20, 2021, 1:36pm UTC](https://discourse.julialang.org/t/hatch-or-groupfill-in-groupedbar-stats-plots/71824 "2021-11-20T13:36:51Z")

</div>

Hello: Is there anyway to fill the bar in groupedbar (statsplots Julia) with something like hatch or groupfill? That would be really useful for publications in black and white. I tried the below without luck Please h…

---

## [StatsPlot -- axes labels overwrite each other](https://discourse.julialang.org/t/statsplot-axes-labels-overwrite-each-other/70539)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 18\
**Last updated:** [October 30, 2021, 3:50pm UTC](https://discourse.julialang.org/t/statsplot-axes-labels-overwrite-each-other/70539 "2021-10-30T15:50:21Z")

</div>

I’m plotting some results from a Turing session. Using the Turing recipe, I get: The problem is the tiny variation in the sample value, which makes the density plot look ugly/overlapping (numeric) labels along the ab…

---

## [StatsPlots & corrplot -- missing color scheme?](https://discourse.julialang.org/t/statsplots-corrplot-missing-color-scheme/70487)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 2\
**Last updated:** [October 28, 2021, 6:37am UTC](https://discourse.julialang.org/t/statsplots-corrplot-missing-color-scheme/70487 "2021-10-28T06:37:10Z")

</div>

I’m trying to do an example at GitHub - JuliaPlots/StatsPlots.jl: Statistical plotting recipes for Plots.jl on how to use corrplot: M = randn(1000,4) M\[:,2\] .+= 0.8sqrt.(abs.(M\[:,1\])) .- 0.5M\[:,3\] .+ 5 M\[:,3\] .-= 0.7M\[:…

---

## [Yaxis scale](https://discourse.julialang.org/t/yaxis-scale/69960)

<div class="topic-metadata">

**Author:** [@dbjulia](https://discourse.julialang.org/u/dbjulia)\
**Replies:** 4\
**Last updated:** [October 18, 2021, 5:36pm UTC](https://discourse.julialang.org/t/yaxis-scale/69960 "2021-10-18T17:36:26Z")

</div>

I am trying to plot some data were the y axis of the plot would be in thousands instead of a log scale. I cannot figure out way to do this in Julia. I have tried a few different back ends but to no avail. Code and image …

---

## [Plots not working with MethodError or Undefined](https://discourse.julialang.org/t/plots-not-working-with-methoderror-or-undefined/68495)

<div class="topic-metadata">

**Author:** [@Hamzah\_Iqbal](https://discourse.julialang.org/u/Hamzah_Iqbal)\
**Replies:** 3\
**Last updated:** [September 21, 2021, 10:19pm UTC](https://discourse.julialang.org/t/plots-not-working-with-methoderror-or-undefined/68495 "2021-09-21T22:19:12Z")

</div>

I am trying to plot columns of a dataframe and tried to run the example here. using StatsPlots, RDatasets gr() iris = DataFrame(dataset("iris")) @df iris scatter( :SepalLength, :SepalWidth, group = :Species,…

---

## [Plotting by multiple factors](https://discourse.julialang.org/t/plotting-by-multiple-factors/68237)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [September 16, 2021, 11:42am UTC](https://discourse.julialang.org/t/plotting-by-multiple-factors/68237 "2021-09-16T11:42:25Z")

</div>

Hi all, I have a dataset with three factors and one dependent variable. In the example below, how do I get all of the linear data in the top plot and all of the exponential data in the bottom plot. I tried changing the …

---

## [Extend density plot line (along 0)](https://discourse.julialang.org/t/extend-density-plot-line-along-0/67561)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 4\
**Last updated:** [September 2, 2021, 6:01pm UTC](https://discourse.julialang.org/t/extend-density-plot-line-along-0/67561 "2021-09-02T18:01:46Z")

</div>

If I write using StatsPlots density(sqrt.(rand(10000))) density!(sqrt.(2\*rand(10000))) then I get: The plot would be nicer if the blue line extended all the way to the maximum/minimum x values (along 0). Is there an…

---

## [How to control group sorting in boxplot?](https://discourse.julialang.org/t/how-to-control-group-sorting-in-boxplot/67432)

<div class="topic-metadata">

**Author:** [@gedankenexperiment](https://discourse.julialang.org/u/gedankenexperiment)\
**Replies:** 2\
**Last updated:** [August 31, 2021, 4:38pm UTC](https://discourse.julialang.org/t/how-to-control-group-sorting-in-boxplot/67432 "2021-08-31T16:38:10Z")

</div>

How can I control the order in which groups are sorted along the x-axis? The xsort attribute seems to be deprecated, cf. How to adjust the X-axis order of boxplot with StatsPlots.jl - #9 by Shuhua I’m using Julia v1.6 a…

---

## [Order of groupedbar](https://discourse.julialang.org/t/order-of-groupedbar/64749)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [July 16, 2021, 7:32pm UTC](https://discourse.julialang.org/t/order-of-groupedbar/64749 "2021-07-16T19:32:10Z")

</div>

I have the following plot of a Likert scale: StatsPlots.groupedbar( repeat(questions, outer = 5), weights, group=repeat(\["1", "2", "3", "4", "5"\], inner=length(questions)), bar\_position=:stack, o…

---

## [Indicate data outside the plotting area](https://discourse.julialang.org/t/indicate-data-outside-the-plotting-area/60646)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 1\
**Last updated:** [May 6, 2021, 2:18pm UTC](https://discourse.julialang.org/t/indicate-data-outside-the-plotting-area/60646 "2021-05-06T14:18:12Z")

</div>

I was doing some boxplots using StatsPlots and I had some outliers. To show the boxes I used ylims! to better show their distribution, but the outliers were off the plot. Is it possible to show a marker at the side of…

---

## [Saving unicodeplots() to txt with color](https://discourse.julialang.org/t/saving-unicodeplots-to-txt-with-color/60069)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 3\
**Last updated:** [April 27, 2021, 9:34pm UTC](https://discourse.julialang.org/t/saving-unicodeplots-to-txt-with-color/60069 "2021-04-27T21:34:59Z")

</div>

This is the solution I didn’t know I needed for quick and dirty hpc plotting. However, they only show up monochrome in #SBATCH --output. Therefore, I tried the following to explicitly save them and neither approach wor…

---

## [How to adjust the X-axis order of boxplot with StatsPlots.jl](https://discourse.julialang.org/t/how-to-adjust-the-x-axis-order-of-boxplot-with-statsplots-jl/56065)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 9\
**Last updated:** [February 27, 2021, 7:37am UTC](https://discourse.julialang.org/t/how-to-adjust-the-x-axis-order-of-boxplot-with-statsplots-jl/56065 "2021-02-27T07:37:24Z")

</div>

using Plots, StatsPlots, DataFrames df = DataFrame( id=repeat(\[3, 17, 21\], inner=10), value=randn(30) ) @df df boxplot(string.(:id), :value, fillalpha=0.75, linewidth=1) The result is I want the box to be 3…

---

## [Support for CategoricalValue in StatsPlots](https://discourse.julialang.org/t/support-for-categoricalvalue-in-statsplots/47523)

<div class="topic-metadata">

**Author:** [@skorpio11](https://discourse.julialang.org/u/skorpio11)\
**Replies:** 3\
**Last updated:** [November 23, 2020, 4:25am UTC](https://discourse.julialang.org/t/support-for-categoricalvalue-in-statsplots/47523 "2020-11-23T04:25:00Z")

</div>

Hi I am following the walkthrough for StatsPlots at: https://github.com/JuliaPlots/StatsPlots.jl Using Julia Version 1.4.1 Got into problems when trying the violin plot: singers = RDatasets.dataset("lattice", "singer…

---

## [Can be visualized clustering with the heatmap()?](https://discourse.julialang.org/t/can-be-visualized-clustering-with-the-heatmap/49903)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 8\
**Last updated:** [November 15, 2020, 2:48pm UTC](https://discourse.julialang.org/t/can-be-visualized-clustering-with-the-heatmap/49903 "2020-11-15T14:48:12Z")

</div>

With this code I get the desired heatmap. using Plots dataMatrix=rand(40,10) heatmap(dataMatrix,levels=10,colorbar=false) But I would like to achieve the image of the heatmap with cluster, as shown in the figure: H…

---

## [How to plot bar chart starting from non-zero y-axis?](https://discourse.julialang.org/t/how-to-plot-bar-chart-starting-from-non-zero-y-axis/49215)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 2\
**Last updated:** [October 29, 2020, 11:07am UTC](https://discourse.julialang.org/t/how-to-plot-bar-chart-starting-from-non-zero-y-axis/49215 "2020-10-29T11:07:18Z")

</div>

Hi, I am trying to plot a bar chart as below: using StatsPlots bar(\[4,5,6\],fillcolor=\[:red,:green,:blue\],fillalpha=\[0.2,0.4,0.6\], group=\["a","b","c"\]) But this plot is starting from Y-axis zero. However, I am lookin…

---

## [Figure gallery with source code and more](https://discourse.julialang.org/t/figure-gallery-with-source-code-and-more/44911)

<div class="topic-metadata">

**Author:** [@yoninazarathy](https://discourse.julialang.org/u/yoninazarathy)\
**Replies:** 0\
**Last updated:** [August 14, 2020, 4:34am UTC](https://discourse.julialang.org/t/figure-gallery-with-source-code-and-more/44911 "2020-08-14T04:34:11Z")

</div>

Hi Community, We’ve created a figure gallery presenting the 126 figures that appear in “Statistics with Julia” and are generated by the open sourced code described in the book. This can perhaps be (another) useful quick…

---

## [Positioning in violin plot](https://discourse.julialang.org/t/positioning-in-violin-plot/42678)

<div class="topic-metadata">

**Author:** [@smonsays](https://discourse.julialang.org/u/smonsays)\
**Replies:** 2\
**Last updated:** [July 8, 2020, 8:39am UTC](https://discourse.julialang.org/t/positioning-in-violin-plot/42678 "2020-07-08T08:39:16Z")

</div>

I would like to add ground truth values to a violin plot. So suppose I knew that for my category "a" the true value is 2.0 and I have a violin plot, I could use scatter like so: violin(repeat(\["a", "b", "c"\], outer=100)…

---

## [Handle numerical values as categories in plots](https://discourse.julialang.org/t/handle-numerical-values-as-categories-in-plots/41256)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 4\
**Last updated:** [June 17, 2020, 4:57pm UTC](https://discourse.julialang.org/t/handle-numerical-values-as-categories-in-plots/41256 "2020-06-17T16:57:58Z")

</div>

I am trying to plot boxplots of values with respect to 4 categories represented as numbers. The four categories are powers of two: 16384, 32768, 65536, 131072. Let’s use this MWE dataframe: using DataFrames, StatsPlots…

---

## [Bar plot with offset array](https://discourse.julialang.org/t/bar-plot-with-offset-array/41122)

<div class="topic-metadata">

**Author:** [@m.lavaiyan](https://discourse.julialang.org/u/m.lavaiyan)\
**Replies:** 5\
**Last updated:** [June 11, 2020, 10:29am UTC](https://discourse.julialang.org/t/bar-plot-with-offset-array/41122 "2020-06-11T10:29:42Z")

</div>

Hi everyone, I want to plot a bar chart an array that starts from index 0. when I use plot() it works fine but when I use bar() it gives this error. How can I plot the bar chart? Thanks for any help! using JuMP, Stat…

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