Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Plots backend documentation unclear #4887

Closed
japhir opened this issue Feb 7, 2024 · 1 comment
Closed

[BUG] Plots backend documentation unclear #4887

japhir opened this issue Feb 7, 2024 · 1 comment

Comments

@japhir
Copy link

japhir commented Feb 7, 2024

Hi! New Julia learner here!

Tried to file this first with Julia, but was told to file the issue here instead JuliaLang/julia#53229.

I've just tried to reproduce this section of the manual but I get the following error:

$ JULIA_PKG_PRECOMPILE_AUTO=0 julia -e 'import Plots; Plots.set_default_backend!(:pythonJULIA_PKG_PRECOMPILE_AUTO=0 julia -e 'import Plots; Plots.set_default_backend!(:pythonplot)'plot)'
ERROR: UndefVarError: `set_default_backend!` not defined
Stacktrace:
 [1] top-level scope
   @ none:1

I found the Plots backend section a little hard to follow: I wanted to understand how to create an interactive version of a plot, which lead me to conclude that I should switch the backend.

Also, PlotlyJS supports saving the output to more formats than Plotly, such as EPS and PDF, and thus is the recommended version of Plotly for developing publication-quality figures.

made me think I should try this out, but I didn't see any docs on how to change the backend temporarily in the docs. Only the above permanent change (that didn't work).

I've also installed Preferences, since the top of the page mentions that this mechanism is used. Still no luck though.
I've now installed PlotlyJS explicitly, but I still get the same error.

I hope this is a helpful issue!

Versions

Plots.jl version: [91a5bcdd] Plots v1.40.1
Backend version (]st -m <backend(s)>): [f0f68f2c] PlotlyJS v0.18.12
Output of versioninfo():

Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:

    Note: This is an unofficial build, please report bugs to the project
    responsible for this build and not to the Julia project unless you can
    reproduce the issue using official builds available at https://julialang.org/downloads

Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 4 × Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 1 on 4 virtual cores

I've installed julia through the pacman package manager for Arch Linux.

@japhir japhir added the bug label Feb 7, 2024
@japhir japhir changed the title [BUG] [BUG] Plots backend documentation unclear Feb 7, 2024
@BeastyBlacksmith
Copy link
Member

Yeah, the docs need to be updated to reflect #4870 .
To temporarily use a different backend you just call the backend function like using Plots; pythonplot(). If it is only for a specific block you can also use with:

with(:pythonplot) do
    plot(1:5)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants