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

savefig + Line + Mac OS #57

Closed
jverzani opened this issue Oct 26, 2024 · 3 comments
Closed

savefig + Line + Mac OS #57

jverzani opened this issue Oct 26, 2024 · 3 comments

Comments

@jverzani
Copy link
Contributor

jverzani commented Oct 26, 2024

Still very much appreciating the efforts you put into this package. Right now, I am finding an issue saving files with a Line object. The following makes a png file as expected:

using Vizagrams
a,b,c = [0,0], [1,0], [0,1]
p =  S(:fill=>:red, :opacity=>0.25) * Polygon([a,b,c])
l = S(:strokeWidth=>2)Line([a,b])
savefig(p; filename=expanduser("/tmp/test.png"))

But adding in a line results in an all black image. If I add other lines, that image gets clipped so it is related to the l.

savefig(p + l; filename="/tmp/test.png")

test

(This all came up when trying to use the typst output of quarto which saves files presumably through savesvg, there an error failed to parse SVG (missing root node) is thrown, though using the html output this does not occur.)

@davibarreira
Copy link
Owner

Still very much appreciating the efforts you put into this package. Right now, I am finding an issue saving files with a Line object. The following makes a png file as expected:


using Vizagrams

a,b,c = [0,0], [1,0], [0,1]

p =  S(:fill=>:red, :opacity=>0.25) * Polygon([a,b,c])

l = S(:strokeWidth=>2)Line([a,b])

savefig(p; filename=expanduser("/tmp/test.png"))

But adding in a line results in an all black image. If I add other lines, that image gets clipped so it is related to the l.


savefig(p + l; filename="/tmp/test.png")

test

(This all came up when trying to use the typst output of quarto which saves files presumably through savesvg, there an error failed to parse SVG (missing root node) is thrown, though using the html output this does not occur.)

I'm out the weekend. I'll check on monday. But my guess is that the issue is an svg thing related to line widths and how they scale. Your image is probably black because the line width.

@jverzani
Copy link
Contributor Author

Thanks! You were right. I have to remember the units are not what I expect them to be.

@davibarreira
Copy link
Owner

It is a very annoying issue. I'm working on some variations for the savefig in order to try to avoid this discrepancy between what you see and when you save.

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

2 participants