JuliaPlots / PlotThemes.jl

Themes for the Julia plotting package Plots.jl
Other
122 stars 29 forks source link

Error bars in :dao theme #70

Closed emmyb-bu closed 1 year ago

emmyb-bu commented 1 year ago

Hi,

I'm making some plots and I need to add error bars to my data.

When I use the following code:

using Plots, PlotThemes; theme(:default)

plot(1:10,rand(10),
yerr = 0.1rand(10),
marker=:circle
)

I get a really nice result:

image

I am able to reproduce the above with several other themes including :juno, :dark, etc. However, when I use the :dao theme, which I prefer because it makes my plots look paper-ready, I don't see any error bars:

using Plots, PlotThemes; theme(:dao)

plot(1:10,rand(10),
yerr = 0.1rand(10),
marker=:circle
)
image

How can I resolve this issue? If the issue is with the source code, are there any quick fixes I can use?

Thanks!

emmyb-bu commented 1 year ago

Update:

I found that the issue is with :markerstrokewidth => 0in the source code for the dao theme. I found that I am able to get my error bars if I added markerstrokewidth to my plot options:

using Plots, PlotThemes; theme(:dao)

plot(1:10,rand(10),
yerr = 0.1rand(10),
marker=:circle,
markerstrokewidth = 1
)
image

The only downside is that the plot markers now have an extra black circle around them, but I can live with that. I hope this helps someone else dealing with a similar issue!