Giter Site home page Giter Site logo

plotthemes.jl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plotthemes.jl's Issues

new breakage in PlotThemes or Plots

error message: ERROR: UndefVarError: theme_palette not defined

Here is the offending (?) line:
co_pal = length(plcols) == 2 ? [theme_palette(thm)[2], theme_palette(thm)[4]] : theme_palette(thm)

That worked for months and months. Just broke with upgrade to Julia 1.5.2 and Plots v 0.28.4 and PlotThemes v1.0.3.

The name theme_palette is exported so I am stymied.

Where is the theme function?

This package used to work for me, but now it seems that it doesn't have a theme/plot_theme function any more? Was this moved to some other package or is there a new selection mechanism?

Deactivate themes/Vanilla theme?

Say I run :dark, but decide that my next plot should not be dark, but just good old vanilla Plots.jl style. Is there currently a way to accomplish this?

error regarding minorticks in surface plot with ggplot2 theme

Hi, I am getting an UndefVarError: minorticks not defined with surface plot but only with the ggplot2 theme. It is my favorite theme...

Just to make sure I didn’t mess up installing too many packages, I isolated an environment with just the following (I couldn't update GR to v0.54.0):

(SurfaceThemes) pkg> status
Project SurfaceThemes v0.1.0
Status `~/Documents/git_repositories/julia/SurfaceThemes/Project.toml`
  [28b8d3ca] GR v0.53.0
  [ccf2f8ad] PlotThemes v2.0.0
  [91a5bcdd] Plots v1.10.2

julia> versioninfo()
Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) m5-6Y54 CPU @ 1.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 2

Here is a simple code to test all themes:

using Plots
gr()
themes = [
    :default
    :dark
    :ggplot2 # somehow throwing error
    :juno
    :lime
    :orange
    :sand
    :solarized
    :solarized_light
    :wong
    :wong2
    :gruvbox_dark
    :gruvbox_light
]

for j = 1:length(themes)
    theme(themes[j])
    try        
        display(surface(-2π:0.1:2π, -2π:0.1:2π, (x,y) -> sin(x) + sin(y),
                        title="Theme $(themes[j])"))
    catch err
        println("Error using theme $(themes[j]): $err")
    end
end

All plots work fine, the only one that gives an error is ggplot2.

Here is the full error stack:

julia> using Plots

julia> gr()
Plots.GRBackend()

julia> theme(:ggplot2)

julia> surface(-2π:0.1:2π, -2π:0.1:2π, (x,y) -> sin(x) + sin(y))
Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: UndefVarError: minorticks not defined
Stacktrace:
 [1] axis_drawing_info_3d(::Plots.Subplot{Plots.GRBackend}, ::Symbol) at /Users/rrosa/.julia/packages/Plots/oZheM/src/axes.jl:818
 [2] gr_draw_axis_3d(::Plots.Subplot{Plots.GRBackend}, ::Symbol) at /Users/rrosa/.julia/packages/Plots/oZheM/src/backends/gr.jl:1282
 [3] gr_draw_axes(::Plots.Subplot{Plots.GRBackend}, ::Array{Float64,1}) at /Users/rrosa/.julia/packages/Plots/oZheM/src/backends/gr.jl:1251
 [4] gr_display(::Plots.Subplot{Plots.GRBackend}, ::Measures.Length{:mm,Float64}, ::Measures.Length{:mm,Float64}, ::Array{Float64,1}) at /Users/rrosa/.julia/packages/Plots/oZheM/src/backends/gr.jl:925
 [5] gr_display(::Plots.Plot{Plots.GRBackend}, ::String) at /Users/rrosa/.julia/packages/Plots/oZheM/src/backends/gr.jl:626
 [6] gr_display at /Users/rrosa/.julia/packages/Plots/oZheM/src/backends/gr.jl:593 [inlined]
 [7] _display(::Plots.Plot{Plots.GRBackend}) at /Users/rrosa/.julia/packages/Plots/oZheM/src/backends/gr.jl:1844
 [8] display(::Plots.PlotsDisplay, ::Plots.Plot{Plots.GRBackend}) at /Users/rrosa/.julia/packages/Plots/oZheM/src/output.jl:150
 [9] display(::Any) at ./multimedia.jl:328
 [10] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [11] invokelatest at ./essentials.jl:709 [inlined]
 [12] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:238
 [13] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:223
 [14] (::REPL.var"#do_respond#54"{Bool,Bool,REPL.var"#64#73"{REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:822
 [15] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [16] invokelatest at ./essentials.jl:709 [inlined]
 [17] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2355
 [18] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:1144
 [19] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at ./task.jl:356

Sorry if I wrote too much.

Error bars in :dao theme

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!

twinx() throws error in custom theme

Hi,

I'm trying to create a custom theme that has the usual settings that I would use in OriginLab for plotting. I've made a modification to wong.jl, and saved it as my own theme:

_themes[:custom] = PlotTheme(
    palette = expand_palette(colorant"white", wong_palette; lchoices [57], cchoices = [100]),
    colorgradient = cgrad(:viridis).colors,
    legend = :false,
    grid = :false,
    twinx(),
    xmirror = :true,
)

However, when I try using Plots with this custom theme, it fails to compile throwing an error about twinx not defined

Is there another syntax for generating a "full" plot (with mirrored x and y axes with tick labels) that could be passed as an argument in a custom theme? After looking over the source code, it looks like twinx() is a function that should be callable, but is maybe getting compiled after PlotThemes.jl?

black plot?

I would like to make a plot with :dark theme, but change the background to be entirely black.

If I do

using Plots
theme(:dark,background_color_outside=:black,foreground_color=:black,background_color=:black); plot(sin)

I get
Screen Shot 2020-10-12 at 11 42 44 AM

Is there some extra property to set the background color inside the figure axis?

Support properties besides colors

It seems like this package has changed slightly from the last time I saw it, and it looks like a PlotTheme now consists only of colors for the various components (or maybe I'm reading wrong?). Specifying things like line width, gridlines, font sizes, etc. would be very useful.

0.6 compatibility

I get the following:

julia> using PlotThemes
INFO: Precompiling module PlotThemes.
ERROR: LoadError: LoadError: MethodError: no method matching distinguishable_colors(::Int64, ::Array{Any,1}; lchoices=linspace(57.0,57.0,1), cchoices=linspace(100.0,100.0,1))
Closest candidates are:
  distinguishable_colors(::Integer; kwargs...) at /Users/solver/.julia/v0.6/Colors/src/colormaps.jl:86
  distinguishable_colors{T<:ColorTypes.Color{T,N}}(::Integer, ::AbstractArray{T<:ColorTypes.Color,1}; transform, lchoices, cchoices, hchoices) at /Users/solver/.julia/v0.6/Colors/src/colormaps.jl:39
  distinguishable_colors(::Integer, ::ColorTypes.Color{T,N}; kwargs...) at /Users/solver/.julia/v0.6/Colors/src/colormaps.jl:85
  ...
 in #expand_palette#3(::Array{Any,1}, ::Function, ::ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}}, ::Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},1}) at /Users/solver/.julia/v0.6/PlotThemes/src/PlotThemes.jl:12
 in (::PlotThemes.#kw##expand_palette)(::Array{Any,1}, ::PlotThemes.#expand_palette, ::ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}}, ::Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},1}) at ./<missing>:0
 in include_from_node1(::String) at ./loading.jl:532
 in include_from_node1(::String) at /Users/solver/Projects/julia6/usr/lib/julia/sys.dylib:?
 in include(::String) at ./sysimg.jl:14
 in include(::String) at /Users/solver/Projects/julia6/usr/lib/julia/sys.dylib:?
 in include_from_node1(::String) at ./loading.jl:532
 in include_from_node1(::String) at /Users/solver/Projects/julia6/usr/lib/julia/sys.dylib:?
 in include(::String) at ./sysimg.jl:14
 in include(::String) at /Users/solver/Projects/julia6/usr/lib/julia/sys.dylib:?
 in anonymous at ./<missing>:2
 in eval(::Module, ::Any) at ./boot.jl:236
 in eval(::Module, ::Any) at /Users/solver/Projects/julia6/usr/lib/julia/sys.dylib:?
 in process_options(::Base.JLOptions) at ./client.jl:248
 in _start() at ./client.jl:335
 in _start() at /Users/solver/Projects/julia6/usr/lib/julia/sys.dylib:?
while loading /Users/solver/.julia/v0.6/PlotThemes/src/dark.jl, in expression starting on line 10
while loading /Users/solver/.julia/v0.6/PlotThemes/src/PlotThemes.jl, in expression starting on line 51
ERROR: Failed to precompile PlotThemes to /Users/solver/.julia/lib/v0.6/PlotThemes.ji.
 in compilecache(::String) at ./loading.jl:672
 in require(::Symbol) at ./loading.jl:453
 in require(::Symbol) at /Users/solver/Projects/julia6/usr/lib/julia/sys.dylib:?

julia> versioninfo()
Julia Version 0.6.0-dev.1552
Commit 7f5ae13 (2016-12-12 23:04 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin16.1.0)
  CPU: Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
  WORD_SIZE: 64
  BLAS: libgfortblas
  LAPACK: liblapack
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)

3D Dark theme - cannot see grid lines

This is the plot I get when I do plot(1:10, 1:10, 1:10) under theme(:dark):

screen shot 2017-02-10 at 2 43 31 pm

Ideally though, I'd like the see the lines on the xy yz and xz planes, like this:

screen shot 2017-02-10 at 2 47 02 pm

Also, great package! :)

API to create custom themes

Hi! It looks like, at the moment, we need to use the PlotTheme type to create new themes. However, this type is not exported by PlotThemes. The add_theme function could also be great for that, but it accepts only PlotTheme objects. Maybe, adding the add_theme(name::Symbol; kargs...) and add_theme(name::Symbol, theme::KW) methods could solve the problem of the missing API without requiring to export PlotTheme. What do you think? Cheers

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Adding R's color brewer pallet

Would you consider adding the R color brewer pallete

e.g. dark2 pallete

dark2 = [
 RGB(([ 27, 158, 119]/255)...),
 RGB(([217,  95,   2]/255)...),
 RGB(([117, 112, 179]/255)...),
 RGB(([231,  41, 138]/255)...),
 RGB(([102, 166,  30]/255)...),
 RGB(([230, 171,   2]/255)...),
 RGB(([166, 118,  29]/255)...),
 RGB(([102, 102, 102]/255)...)
 ]

image

see Github source

[FR] Atheme, similar to Mathematica's monochrome theme

Mathematica has a very nice theme in which: the first line is black, the second is black dashed, the third is black dotted and so on.

Such a theme is very useful for publication purposes, since most journals require a monochrome theme.

Theme :dao + twinx() gives wrong 2nd y-axis position

Hej.
It seems that :dao has a wrong indentation for the position on 2nd y-axis.
using this example:

theme(:dao) a,b = rand(120),rand(120); plot(a,legend=false, yflip=true,tick_direction = :out,ylabel="B [mm]"); twinx(); plot!(b,ylabel="B [mm]")

dao_twinx
switching to :default i get the desired result:

def_twinx

ERROR: Unknown key: colorgradient

I have tried to use plots theme and I got this error:

ERROR: Unknown key: colorgradient

using Plots
theme(:dark)

plot(rand(10)

julia 1.0.5
Plots v0.27.1

Should this be a dependency of Plots?

I could remove the theme stuff from Plots and keep anything theme-related here, re-exporting PlotThemes.plot_theme (or maybe just theme??)

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.