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

twinx() and fgcolor issue #554

Open
thojDufour opened this issue Jul 25, 2022 · 2 comments
Open

twinx() and fgcolor issue #554

thojDufour opened this issue Jul 25, 2022 · 2 comments

Comments

@thojDufour
Copy link

I'm having an error when using pyplot backend, and twinx().
If I modify the backgroud color and try to use twinx() to have 2 y axes, I get the following error:
ERROR: UndefVarError: fgcolor not defined.
I'm using Arch linux and I installed Julia from the AUR package julia-bin.

Below is a minimum example to reproduce the error:

using Plots
using LaTeXStrings
pyplot()

plot_font = "CMU Typewriter Text"

default(fontfamily=plot_font,
    linewidth=2, framestyle=:box, 
    label=nothing, grid=true, minorgrid=true, 
    minorgridls=:dot, gridls=:dash, 
    gridlw=1, minorgridlw=0.75, 
    background_color=RGB(7/255,54/255,66/255),
    # fgcolor=RGB(255/255,255/255,255/255),
    right_margin=15Plots.mm,
    bottom_margin=5Plots.mm
)

a = 1:10
b = rand(10)
plot(a,b, label = L"randData", ylabel = "Rand data",color = :red, legend = :topleft)
p = twinx()
plot!(p,a,log.(a), label = L"log(x)", legend = :topright, ylabel = "The right Y label",
    xlabel = "numbers")
#savefig("test")
gui()```
@thojDufour
Copy link
Author

Issue also present on Windows 10, Julia 1.7.3, with updated version of Plots and PyPlots.

@thojDufour
Copy link
Author

Issue seems only to be one when using default.

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

No branches or pull requests

1 participant