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

fontcolor not working in GR #1853

Closed
blegat opened this issue Nov 28, 2018 · 7 comments
Closed

fontcolor not working in GR #1853

blegat opened this issue Nov 28, 2018 · 7 comments
Labels

Comments

@blegat
Copy link
Contributor

blegat commented Nov 28, 2018

using Plots
gr()
plot(xlim=(0.0, 2.0), ylim=(0.0, 2.0))
annotate!(1.0,  1.0, Plots.text("1", color))

is white if color is :white or :red and black if color is :black, :green or :blue. It works fine with Plotly or PyPlot though.

@blegat
Copy link
Contributor Author

blegat commented Nov 28, 2018

Adding @show color at

gr_set_textcolor(color)

gives

color = RGBA{Float64}(0.0,0.0,0.0,1.0)

@dgleich
Copy link

dgleich commented Jan 8, 2019

Just bumped into this issue today too.

@daschw
Copy link
Member

daschw commented Jun 15, 2019

This issue affects all texts in Plots with GR. plot(rand(10), xguide = "I should be red", xguidefontcolor = :red) does not work either.
gr_fontcolor
Plots passes all the colors correctly. There seems to be a problem with GR.settextcolorind.
@jheinen Would you know anything about that?

@daschw daschw changed the title GR annotate! color are black or white fontcolor not working in GR Jun 15, 2019
@jheinen
Copy link
Member

jheinen commented Jun 16, 2019

Works fine in gksqt or for PDF - seems to be related to the Cairo PNG part in GR. Will check this next week ...

@jheinen
Copy link
Member

jheinen commented Jun 17, 2019

This problem is fixed in GR master.

@daschw
Copy link
Member

daschw commented Jun 17, 2019

This problem is fixed in GR master.

It works for me in the GKS QT Term but not in Atom/Juno.

@Semptum
Copy link

Semptum commented May 23, 2020

The problem persists for SVGs and PNGs for GR 0.49.0 though a bit differently so I'm not sure whether I should make a separate issue but it seems like that might just be a continuation of this one.
I can set fontcolors using some colors such as :white or :red. But if I try to use some custom color it just outputs with the color #3d3d3d (for PNGs) or black (for SVGs). It works fine for PDFs.
Here is a MNWE:

using Plots
gr()
magenta = colorant"#d33682"
Plots.plot(titlefont=font(12,"times",magenta),title="Should be magenta")
Plots.plot!(rand(10))

And here is the result. (EDIT: I had not restarted Julia so it had the wrong background). Running it anew, I don't see the #3d3d3d color in PNGs so it must be an Atom thing. But the color is still not the right one. )
magenta.pdf
magenta

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

No branches or pull requests

7 participants