# Why my plot looks weired and different from others'?

**URL:** <https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536>\
**Category:** General Usage\
**Created:** [May 15, 2020, 5:01pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536 "2020-05-15T17:01:32Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![DShiu](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Post date:** [May 15, 2020, 5:01pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/1 "2020-05-15T17:01:32Z")

</div>

I used the code from Quantecon to create a plot. It looks weird with thick lines and its background. I guess the issue is with my computer because both Jupyter notebook and Juno gave the same result.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/d/6dcf5d04aa8f0c1f839c1373bf152fd8ee224806.png)

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [May 15, 2020, 5:09pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/2 "2020-05-15T17:09:31Z")

</div>

Hi @DShiu,

Would you please post the code you used to create the graph? There are lots of examples and several different plotting libraries so we need a bit more information to be able to help.

---

<div class="post-metadata">

**Author:** ![DShiu](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Post date:** [May 15, 2020, 5:21pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/3 "2020-05-15T17:21:44Z")

</div>

```julia

using InstantiateFromURL
github_project("QuantEcon/quantecon-notebooks-julia", version = "0.5.0")
# uncomment to force package installation
# github_project("QuantEcon/quantecon-notebooks-julia", version="0.5.0", instantiate=true)
using LinearAlgebra, Statistics
using Distributions, Expectations, NLsolve, Roots, Random, Plots, Parameters
gr(fmt = :png);;

n = 50
dist = BetaBinomial(n, 200, 100) # probability distribution
@show support(dist)
w = range(10.0, 60.0, length = n+1) # linearly space wages

using StatsPlots
plt = plot(w, pdf.(dist, support(dist)), xlabel = "wages", ylabel = "probabilities", legend = false)

```

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [May 15, 2020, 6:01pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/4 "2020-05-15T18:01:56Z")

</div>

This example looks like it might be pretty old and I’m having trouble running it. What version of Julia are you using?

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [May 15, 2020, 6:06pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/5 "2020-05-15T18:06:15Z")

</div>

Nvm, it ran. I’m getting this result:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/b/eb9d07d0044e654065497b66993088ced5216007.png)

What environment are you running in? I’m using Atom w/ Juno, and the above is snipped from a screenshot. [EDIT: you said Juno and Jupyter. How about Julia and OS versions?]

---

<div class="post-metadata">

**Author:** ![DShiu](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Post date:** [May 16, 2020, 1:19am UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/6 "2020-05-16T01:19:06Z")

</div>

Your plot looks good to me. My was from Julia 1.3.1 and Windows 10. I got the same weired plot on both Juno and Jupyter.

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [May 16, 2020, 1:43am UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/7 "2020-05-16T01:43:02Z")

</div>

I don’t know what’s causing that difference.

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [May 16, 2020, 4:00am UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/8 "2020-05-16T04:00:57Z")

</div>

Hi DShiu, I got a similar problem which is similar to yours.

I have trace my problem to Plots

And to solve my problem I did this

Pin Plots to version 0.29.9

[91a5bcdd] Plots v0.29.9 ⚲

I think there is some issue which cause Plots to jump back to version 0.27.X something to do with dependecies

PS: I think the problem is cause by some new version of StatsPlots

I had to reset StatsPlots to an older version below  
add StatsPlots@0.14.1

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [May 16, 2020, 4:14am UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/9 "2020-05-16T04:14:11Z")

</div>

I think this is the problem with StatsPlots that is causing the problem with Plots going back to 0.27.x

 ![Screen Shot 2020-05-16 at 2.12.38 PM](https://global.discourse-cdn.com/julialang/original/3X/8/6/86df7678d85f4c30fc5567c4999869d9540a4bb8.png)

I am not an expert on Julia packages so my explanation may be wrong.  
But this is what I think happened.  
StatsPlots went from 0.14.1 to a newer version  
This cause Plots to go from 0.29.9 to 0.27.x  
This cause your graphs to look weird.

---

<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:** [May 16, 2020, 9:36am UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/10 "2020-05-16T09:36:55Z")

</div>

This is unlikely to be the reason as (1) StatsPlots is compatible with the current Plots version (which is 1.2.5 btw, not 0.29) and (2) the look of the standard Plots hasn’t changed for a long time, and they never (to my knowledge) looked like the above.

What’s the output of `]st` for your environment, @DShiu? Also, what does a plot look like if you just do

```julia
julia> using Plots

julia> plot(rand(10))

```

?

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [May 16, 2020, 9:57am UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/11 "2020-05-16T09:57:51Z")

</div>

…and what’s your `backend()`? To me it looks like there might be some configuration loaded in the background (matplotlib can be configured via `~/.matplotlib/matplotlibrc`, maybe also `GR`?).

EDIT: I don’t use `Plots.jl` anymore so not sure how the backend is set implicitly…

---

<div class="post-metadata">

**Author:** ![DShiu](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Post date:** [May 16, 2020, 3:10pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/12 "2020-05-16T15:10:39Z")

</div>

Below are the output I got:

(quantecon-notebooks-julia) pkg\> st  
Project quantecon-notebooks-julia v0.5.0  
Status `D:\Dropbox\Research\Project.toml`  
[2169fc97] AlgebraicMultigrid v0.2.2  
[28f2ccd6] ApproxFun v0.11.5  
[7d9fca2a] Arpack v0.3.1  
[aae01518] BandedMatrices v0.10.1  
[6e4b80f9] BenchmarkTools v0.4.3  
[a134a8b2] BlackBoxOptim v0.5.0  
[ffab5731] BlockBandedMatrices v0.4.6  
[324d7699] CategoricalArrays v0.7.1  
[34da2185] Compat v2.1.0  
[a93c6f00] DataFrames v0.19.4  
[1313f7d8] DataFramesMeta v0.5.0  
[5721bf48] DataVoyager v0.3.1  
[39dd38d3] Dierckx v0.4.1  
[9fdde737] DiffEqOperators v3.5.0  
[31c24e10] Distributions v0.21.3  
[2fe49d83] Expectations v1.1.1  
[a1e7a1ef] Expokit v0.2.0  
[d4d017d3] ExponentialUtilities v1.5.1  
[442a2c76] FastGaussQuadrature v0.4.0  
[1a297f60] FillArrays v0.6.4  
[9d5cd8c9] FixedEffectModels v0.8.5 ⚲  
[c8885935] FixedEffects v0.3.0 ⚲  
[587475ba] Flux v0.9.0  
[f6369f11] ForwardDiff v0.10.3  
[38e38edf] GLM v1.3.1 ⚲  
[28b8d3ca] GR v0.41.0  
[40713840] IncompleteLU v0.1.1  
[43edad99] InstantiateFromURL v0.4.0  
[a98d9a8b] Interpolations v0.12.2  
[b6b21f68] Ipopt v0.6.0  
[42fd0dbc] IterativeSolvers v0.8.1  
[4076af6c] JuMP v0.20.0  
[5ab0869b] KernelDensity v0.5.1  
[ba0b0d4f] Krylov v0.3.0  
[0b1a1467] KrylovKit v0.4.0  
[b964fa9f] LaTeXStrings v1.0.3  
[5078a376] LazyArrays v0.10.0  
[0fc2ff8b] LeastSquaresOptim v0.7.4  
[093fc24a] LightGraphs v1.3.0  
[7a12625a] LinearMaps v2.5.2  
[5c8ed15e] LinearOperators v0.5.4  
[76087f3c] NLopt v0.5.1  
[2774e3e8] NLsolve v4.0.0  
[429524aa] Optim v0.19.3  
[1dea7af3] OrdinaryDiffEq v5.3.0  
[d96e819e] Parameters v0.12.0  
[14b8a8f1] PkgTemplates v0.6.3  
[91a5bcdd] Plots v0.27.0  
[f27b6e38] Polynomials v0.5.2  
[af69fa37] Preconditioners v0.3.0  
[92933f4c] ProgressMeter v1.1.0  
[1fd47b50] QuadGK v2.1.0  
[fcd29c91] QuantEcon v0.16.1  
[1a8c2f83] Query v0.12.2  
[ce6b1742] RDatasets v0.6.3  
[d519eb52] RegressionTables v0.2.2 ⚲  
[295af30f] Revise v2.2.0  
[f2b01f46] Roots v0.8.3  
[df8f2f22] SASLib v1.2.0  
[47a9eef4] SparseDiffTools v0.8.0  
[684fba80] SparsityDetection v0.1.1  
[90137ffa] StaticArrays v0.11.0  
[2913bbd2] StatsBase v0.32.0  
[3eaba693] StatsModels v0.6.5  
[f3b207a7] StatsPlots v0.12.0  
[88034a9c] StringDistances v0.6.4  
[112f6efa] VegaLite v0.7.0  
[e88e6eb3] Zygote v0.3.4  
[37e2e46d] LinearAlgebra  
[9a3f8284] Random  
[2f01184e] SparseArrays  
[10745b16] Statistics  
[8dfed614] Test

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/4/148b784028081e88274dd3755f8f5042c9f7f6b9.png)

---

<div class="post-metadata">

**Author:** ![DShiu](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Post date:** [May 16, 2020, 3:11pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/13 "2020-05-16T15:11:15Z")

</div>

Plots.GRBackend()

---

<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:** [May 16, 2020, 3:48pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/14 "2020-05-16T15:48:16Z")

</div>

Okay so your Plots and GR version are out of date, and you could try `]up`’ing, although I see that you’ve got quite a few packages pinned to certain versions so they might restrict you from upgrading.

Still this makes it harder to debug, so can you just make a new environment, add only `Plots` to it and then try a simple plot again?

---

<div class="post-metadata">

**Author:** ![DShiu](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Post date:** [May 16, 2020, 4:05pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/15 "2020-05-16T16:05:35Z")

</div>

I restarted Juno and made the plot. It looks normal now. So I guess the issue is from QuantEcon.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/1/a100ebfdf4b554720f197a2f831df2d8ebe17a7f.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [September 24, 2020, 10:19pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536/16 "2020-09-24T22:19:12Z")

</div>

Perhaps QuantEcon sets undesirable defaults [http://docs.juliaplots.org/latest/generated/gr/#gr-ref42](http://docs.juliaplots.org/latest/generated/gr/#gr-ref42)
