# StatPlots changes name to StatsPlots and PlotRecipes to GraphRecipes

**URL:** https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175
**Category:** Package Announcements
**Tags:** package, announcement, plotting
**Created:** [January 28, 2019, 9:30am UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175 "2019-01-28T09:30:22Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [January 28, 2019, 9:30am UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/1 "2019-01-28T09:30:22Z")

</div>

StatPlots has just changed it’s name to StatsPlots. This means that to keep using the package (on julia 1+), you will need to

```julia
]rm StatPlots
]add StatsPlots

```

If you have any tutorials using StatsPlots, please change the name in there as well.

The change happens for consistency with the JuliaStats ecosystem, that has StatsModels, StatsKit, and the other plotting package with similar goals, StatsMakie. This reflects that a design goal of StatsPlots is to provide recipes for all statistical types defined in packages included by StatsKit, so that people can plot regressions, clusters, PCAs etc. seamlessly, and that StatsPlots will take on dependencies on the Stats packages to do so.

Note that we are aware that this is not the best design for such functionality. A much ligther design would be for the packages defining the types to take a dependency on the very small non-interfering package RecipesBase (400 loc with no dependencies and no exported names, which only changes along with julia minor versions) and defining recipes for the structs.

The StatsPlots approach reflects our conviction that statistical objects must have plotting functionality defined. And if the better light-weight recipes approach is adopted in the future it would be very easy to port the functionality to StatsKit or the individual stats packages.

In a similar change, we have refactored the PlotRecipes to only contain graph-related recipes (other recipes have been moved to StatsPlots) and renamed it to GraphRecipes.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [January 28, 2019, 9:35am UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/2 "2019-01-28T09:35:09Z")

</div>

```julia
(v1.1) pkg> add StatsPlots
ERROR: The following package names could not be resolved:
 * StatsPlots (not found in project, manifest or registry)
Please specify by known `name=uuid`.

```

Does this change take some time to filter through?

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [January 28, 2019, 9:38am UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/3 "2019-01-28T09:38:19Z")

</div>

It was merged half an hour ago. Maybe `]up` first?

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [January 28, 2019, 9:48am UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/4 "2019-01-28T09:48:37Z")

</div>

Of course - thanks!

---

<div class="post-metadata">

### Author: ![ValdarT](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/valdart/32/24146_2.png) [@ValdarT](https://discourse.julialang.org/u/ValdarT)
#### Post date: [January 28, 2019, 10:59am UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/5 "2019-01-28T10:59:17Z")

</div>

I hope you’ll tag a new release of `Plots` as well, soon. Currently `Plots` prints (wrong) warnings for `violin` and `boxplot` due to this.

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [January 28, 2019, 1:02pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/6 "2019-01-28T13:02:09Z")

</div>

I just tagged v0.23.0

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [January 28, 2019, 1:48pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/7 "2019-01-28T13:48:49Z")

</div>

The old `StatPlots.jl` also had issues where it was tough to do a `using Plots` prior to the `using StatPlots` since it was re-exporting everything. Has that been removed in this or recent updates?

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [January 28, 2019, 4:23pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/8 "2019-01-28T16:23:53Z")

</div>

No, you shouldn’t do `using Plots`. Changing that behaviour would require a complete refactoring of the package.

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [January 28, 2019, 5:01pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/9 "2019-01-28T17:01:38Z")

</div>

Oh well, it sure would be nice one day to have that some day (and it is pretty inconsistent with how other packages operate).

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [January 29, 2019, 9:54am UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/10 "2019-01-29T09:54:48Z")

</div>

Not really actually. StatPlots depends on Plots and reexports it, so you shouldn’t be loading Plots. That’s how dependencies work in general.

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [January 29, 2019, 1:39pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/11 "2019-01-29T13:39:11Z")

</div>

> [@mkborregaard](#):
>
> StatPlots depends on Plots and reexports it,

This is my issue. Why does it reexport a common dependency that people are likely to already have loaded? I have never run into this before, and I use a lot of packages. Maybe they reexport hidden “Base” dependencies people would never include directly, but I can’t think of an example where they reexport a commonly used dependency likely to be in the code.

Imagine the usage scenario, which I am doing all the time… Load up Plots.jl close to the top of my notebook or code. Maybe even do the `using Plots` compiled into the image from @sdanisch and [Plots Environment - Nextjournal](https://nextjournal.com/sdanisch/plots-static) as soon as I can…

Then I decide I want to use some Stats recipes. Why does that need to break all of my existing code?

Is it essential to the architecture? Because it is an annoyance rather than a feature. If the solution is simply "don’t reexport and tell people they need to replace existing `using StatPlots` with `using Plots, StatPlots`, I think that is a minor impact on users.

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [January 29, 2019, 3:16pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/12 "2019-01-29T15:16:07Z")

</div>

Do you have a reproducible example? Everything I have tried works just fine.

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [January 29, 2019, 3:22pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/13 "2019-01-29T15:22:46Z")

</div>

@arnavsood can you check with the latest and QE lectures? Maybe this isn’t an issue any more. @Nosferican do you remember the details as well?

---

<div class="post-metadata">

### Author: ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)
#### Post date: [January 29, 2019, 3:36pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/14 "2019-01-29T15:36:19Z")

</div>

[https://github.com/JuliaPlots/StatsPlots.jl/issues/195](https://github.com/JuliaPlots/StatsPlots.jl/issues/195)

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [January 29, 2019, 3:40pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/15 "2019-01-29T15:40:28Z")

</div>

That example works for me.

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [January 29, 2019, 3:41pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/16 "2019-01-29T15:41:05Z")

</div>

Thanks. @mkborregaard from your comments on that:

> The solution in the longer run will most likely be to not reexport Plots, and thus require you to load Plots

I think this is worthwhile to, especially when pushing out the name change. They are already revisiting all `using` with it

---

<div class="post-metadata">

### Author: ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)
#### Post date: [January 29, 2019, 3:49pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/17 "2019-01-29T15:49:13Z")

</div>

I can confirm at least the initial issue is no longer a problem. We can test if there are any more issues with loading Plots before StatsPlots, but for now it could be that the issues have been resolved silently.

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [January 29, 2019, 4:27pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/18 "2019-01-29T16:27:43Z")

</div>

> [@jlperla](#):
>
> Why does that need to break all of my existing code?

@jlperla this is needless hyperbole. `using Plots, StatPlots` has never broken all of anyone’s code. There has been a very few niche cases like the one @Nosferican posted where loading the package and issuing plot statements in a specific order caused a few recipes to work less well, that’s all.

StatPlots reexports Plots because it’s intended as an alternative larger package for those that don’t mind having the Stats packages too. So there’s no reason to do `using Plots; using StatPlots` and that’s all you’ve been told. Do it if you must, by all means, I don’t care.

Instead you’re taking over a discourse issue on something completely unrelated with hyperbolic descriptions of a non-existing problem you have, and a requirement that we reimplement the entire package to accomodate it. This comes with no associated desire to contribute, you’ve not even opened an issue about it with an MWE.

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [January 29, 2019, 5:19pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/19 "2019-01-29T17:19:07Z")

</div>

You are asking everyone to go back and change their `using StatPlots` in their code, so it is a reasonable time to ask if we can also change this to `using Plots` and then `using StatsPlots` as well. If you think I should have posted separately, I apologise.

> [@mkborregaard](#):
>
> @jlperla this is needless hyperbole. `using Plots, StatPlots` has never broken all of anyone’s code.

Sorry, I think you misunderstood the tone of me walking through a user experience. No hyperbole intended, just trying to convey the confusion that I (and other people would have) in running through lecture notes if they had already done a using Plots and can’t figure out why `StatsPlots` won’t work.

The problem is that “niche” case is the only one I had ever run into. We had people carefully testing dependencies and trying to patch them where possible.

> [@mkborregaard](#):
>
> Instead you’re taking over a discourse issue on something completely unrelated with hyperbolic descriptions of a non-existing problem you have, and a requirement that we reimplement the entire package to accomodate it. This comes with no associated desire to contribute, you’ve not even opened an issue about it with an MWE.

There was a posted minimum working example, carefully tested in a publicly accessible piece of code… I had @arnavsood and @Nosferican test it and try to come up with fixes, but they told me they were unable to do it without you because of the architecture of the package. They posted [Broken for Distributions? · Issue #195 · JuliaPlots/StatsPlots.jl · GitHub](https://github.com/JuliaPlots/StatsPlots.jl/issues/195) to discuss with you to verify the problem, and you responded

> The solution in the longer run will most likely be to not reexport Plots, and thus require you to load Plots.

This isn’t me asking you to rewrite a package, but rather checking in to see if you had done what you had said you were planning to do. The answer could simply be “sorry, didn’t get around to it or I changed my mind… or lets discuss this in another thread… or could use some help”, but I don’t understand the need for an attack.

Regardless, we will retest this to see if the initial issues how now been fixed through some other change. Perhaps your idea to “not reexport Plots” was not the only way to solve it.

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [January 29, 2019, 9:33pm UTC](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175/20 "2019-01-29T21:33:18Z")

</div>

> [@jlperla](#):
>
> There was a posted minimum working example, carefully tested in a publicly accessible piece of code…

Hi @jlperla if you are involved in this issue then I apologize for saying you didn’t open one - I didn’t realize you were behind this, so that was unfair.  
And sorry for reacting so strongly - it was simply the gap between the actual inconvenience (I believe the issue was only ever with plotting Distributions when loading packages in the order Distributions, Plots, StatPlots), your description of the problem (“break all of my existing code”) and the requested fix (reimplement the package).

I didn’t realize it at the time of commenting on the issue, but a few days after it was opened I spent most of a day trying to make StatPlots Plots-independent, and ended up running into various issues, realizing how big of a rework it was and dropping the idea. So the idea of making StatPlots Plots-independent has been abandoned.

Reexporting Plots was never a temporary hack - it was part of Tom Breloffs philosophy that StatPlots should be the package of choice for people using statistics, instead of Plots. I very rarely just do `using Plots` myself. I guess the relationship can be redesigned (like we did for Plot/GraphRecipes which is now Plots-free), e.g. today the Tables interface is so light it should probably just live in Plots.

I’ll add that I have no idea why the problem disappeared, it’s certainly not due to a change in StatPlots - one guess might be that julia has become better at cache-invalidating compiled methods?

[Next page](https://discourse.julialang.org/t/statplots-changes-name-to-statsplots-and-plotrecipes-to-graphrecipes/20175.md?page=2)
