# Confidence interval with Plots and pgfplots()

**URL:** <https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440>\
**Category:** General Usage\
**Tags:** pgfplotsx\
**Created:** [November 24, 2019, 2:47am UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440 "2019-11-24T02:47:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [November 24, 2019, 2:47am UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/1 "2019-11-24T02:47:36Z")

</div>

Hi,

I would like to run this type of code

```julia
using Plots 
pgfplots()
aa = rand(10)
bb = rand(10)
cc = rand(10)
conf = [aa-cc bb-cc]
p = plot(collect(1:10),cc)
plot!(cc,ribbon=conf)

```

This code works well is I replace pgfplots() with pyplot(). Basically, I can’t find a way to plot confidence intervals with pgfplots().

---

<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:** [November 24, 2019, 8:37am UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/2 "2019-11-24T08:37:20Z")

</div>

Not all backends support all series and attributes, you can check which ones are supported here:

[https://docs.juliaplots.org/latest/supported/](https://docs.juliaplots.org/latest/supported/)

This shows that indeed the pgfplots backends does not currently support `ribbon `

---

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [November 24, 2019, 8:23pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/3 "2019-11-24T20:23:59Z")

</div>

Thank you. Any chance ribbon will be added to pgfplots()? I don’t know who is in charge of the package but it could be nice.

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [November 25, 2019, 1:22pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/4 "2019-11-25T13:22:03Z")

</div>

I just added that to the upcoming `PGFPlotsX` backend. You could try that already out by `add https://github.com/BeastyBlacksmith/Plots.jl#pgfplotsx`.  
Don’t hesitate to ping me, if you run into any issues.

---

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [November 25, 2019, 7:57pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/5 "2019-11-25T19:57:14Z")

</div>

Awesome, thanks! Can you explain how exactly I can try it? since you said upcoming, I assume it is not there yet. When will it become available like any other backend?

---

<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:** [November 25, 2019, 8:20pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/6 "2019-11-25T20:20:12Z")

</div>

> [@BeastyBlacksmith](#):
>
> I just added that to the upcoming `PGFPlotsX` backend.

Spectacular! We have been using that package directly but would love to use Plots frontend instead.  
What is the timeline for that backend? Is the current PGFPlots moving to deprecated status?

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [November 25, 2019, 9:46pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/7 "2019-11-25T21:46:12Z")

</div>

Its in the finishing phase. What it needs most now are brave souls who checkout the development branches and report whats is still missing.

```julia
add https://github.com/BeastyBlacksmith/Plots.jl#pgfplotsx
add PGFPlotsX#master

```

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [November 25, 2019, 9:47pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/8 "2019-11-25T21:47:43Z")

</div>

> [@jlperla](#):
>
> Is the current PGFPlots moving to deprecated status?

They will coexist for a while until it is sure that they are functionally equivalent.

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [November 30, 2019, 11:16am UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/9 "2019-11-30T11:16:32Z")

</div>

Its out. Give it a try and I would love to get some feedback.  
Best to report bugs/whishes in the [meta issue](https://github.com/JuliaPlots/Plots.jl/issues/2290).

---

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [December 1, 2019, 10:25pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/10 "2019-12-01T22:25:05Z")

</div>

Great, thanks. Still, how can we use it?

```julia
using Plots
pgfplotsx()

```

says pgfplotsx is not defined–while I don’t get this error with pgfplots() or pyplots()

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [December 2, 2019, 10:03am UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/11 "2019-12-02T10:03:41Z")

</div>

It is merged and will come with the next release.  
Meanwhile you can use it by

```julia
] add Plots#master

```

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [December 3, 2019, 5:07pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/12 "2019-12-03T17:07:43Z")

</div>

It is now released.

```julia
] add Plots PGFPlotsX
using Plots; pgfplotsx()

```

---

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [December 5, 2019, 3:17am UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/13 "2019-12-05T03:17:48Z")

</div>

Should I find it there already? pgfplotsx() gives “not defined”

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [December 5, 2019, 11:06am UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/14 "2019-12-05T11:06:03Z")

</div>

What is your Plots version? It is part of Plots v0.28.2.

---

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [December 5, 2019, 1:04pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/15 "2019-12-05T13:04:49Z")

</div>

Got it, I am running 0.27.0. The thing is, it doesn’t let me update it (which is weird, because I just downloaded Julia 1.3 without explicitly imposing requirements)

```julia
Pkg.add(Pkg.PackageSpec(;name="Plots", version="0.28.2"))
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Plots [91a5bcdd]:
 Plots [91a5bcdd] log:
 ├─possible versions are: [0.12.1-0.12.4, 0.13.0-0.13.1, 0.14.0-0.14.2, 0.15.0-0.15.1, 0.16.0, 0.17.0-0.17.4, 0.18.0, 0.19.0-0.19.3, 0.20.0-0.20.6, 0.21.0, 0.22.0-0.22.5, 0.23.0-0.23.2, 0.24.0, 0.25.0-0.25.3, 0.26.0-0.26.3, 0.27.0] or uninstalled
 └─restricted to versions 0.28.2 by an explicit requirement — no versions left
Stacktrace:
 [1] check_constraints(::Pkg.GraphType.Graph) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/GraphType.jl:937
 [2] Pkg.GraphType.Graph(::Dict{Base.UUID,Set{VersionNumber}}, ::Dict{Base.UUID,Dict{Pkg.Types.VersionRange,Dict{String,Base.UUID}}}, ::Dict{Base.UUID,Dict{Pkg.Types.VersionRange,Dict{String,Pkg.Types.VersionSpec}}}, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Types.Fixed}, ::Bool) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/GraphType.jl:364
 [3] deps_graph(::Pkg.Types.Context, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Types.Fixed}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:437
 [4] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:320
 [5] #add#112(::Bool, ::Pkg.BinaryPlatforms.MacOS, ::typeof(Pkg.Operations.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:1010
 [6] #add at ./none:0 [inlined]
 [7] #add#25(::Bool, ::Pkg.BinaryPlatforms.MacOS, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:102
 [8] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:72
 [9] #add#20 at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:69 [inlined]
 [10] add(::Pkg.Types.PackageSpec) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:66
 [11] top-level scope at none:0

```

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [December 5, 2019, 1:27pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/16 "2019-12-05T13:27:35Z")

</div>

I can’t replicate that. Does this also happen if you activate a new environment?  
Like

```julia
] activate clean
add Plots@0.28.2

```

Also updating the previous environment could help.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [December 5, 2019, 2:05pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/17 "2019-12-05T14:05:24Z")

</div>

Are you using JuliaPro? Perhaps that registry updated.

---

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [December 5, 2019, 2:12pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/18 "2019-12-05T14:12:52Z")

</div>

I am using Julia + Atom. Using

```julia
activate clean 

```

doesn’t fix the problem.

Maybe I should try JuliaPro

---

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [December 5, 2019, 2:42pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/19 "2019-12-05T14:42:59Z")

</div>

I am bit confused on how you can get Plots 0.28.2. Shall I delete and re-install Julia? Change the registry somehow?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [December 5, 2019, 2:50pm UTC](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440/20 "2019-12-05T14:50:40Z")

</div>

You can try `registry rm General` and then `registry add General` in the Pkg REPL mode.

[Next page](https://discourse.julialang.org/t/confidence-interval-with-plots-and-pgfplots/31440.md?page=2)
