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

vg/vgimg: fails to draw horizontal lines with many line segments #687

Closed
kortschak opened this issue Apr 21, 2021 · 6 comments · Fixed by #741 or #785
Closed

vg/vgimg: fails to draw horizontal lines with many line segments #687

kortschak opened this issue Apr 21, 2021 · 6 comments · Fixed by #741 or #785

Comments

@kortschak
Copy link
Member

What are you trying to do?

Plot a long data series.

What did you do?

This won't run in playground due to timeout, but change the playground constant to false and it will run locally.

https://play.golang.org/p/gSINhzskCHi

What did you expect to happen?

Plot something equivalent to this (svg output).
Screenshot from 2021-04-21 09-24-46

What actually happened?

bug

The plot is correct with svg, eps and pdf formats, but missing the horizontal segment with png, tiff and jpg, so it appears to be due to vg/vgimg. The *Canvas.Stroke method is a thin wrapper around *"github.com/fogleman/gg".Context.Stroke, so the error may there. Note also that the effect is not noticeably visible for len(data) values lower than ~4000 in the bug.go reproducer.

What version of Go and Gonum/plot are you using?

v0.9.0 caab778

Does this issue reproduce with the current master?

Yes.

@sbinet
Copy link
Member

sbinet commented Apr 21, 2021

@kortschak
Copy link
Member Author

Possibly #645, but I don't think it looks like #559.

@FP-Guitar
Copy link

FP-Guitar commented Sep 28, 2021

Ran into a similar issue than this. Followed the "Duplicate" issue and can reproduce the behaviour:
"Works with pdf and svg backend, fails with tiff".
For mit this is a real problem, because I really need to do plots with large datasets and high resolution and pdf or svg is very slow with most viewers.

@sbinet
Copy link
Member

sbinet commented Sep 28, 2021

then this is an issue with the underlying gg package we use for the vgimg backend:

I must admit I haven't followed up and didn't dive in freetype/raster...
did you try using vg/vggio in headless mode?
as hinted there vg/vggio may give slightly better results.

@sbinet
Copy link
Member

sbinet commented Nov 25, 2021

well... as mentioned in fogleman/gg#85 (comment) it's been a while.
I'll probably bite the bullet and fork (where? sbinet-gonum/gg? gonum/plot-vgimg-gg?) gg to fix this issue.
any suggestions/preferences as to where this should live?

@kortschak
Copy link
Member Author

I don't think I can answer that because the choice is essentially an indication of where the burden will lie and that's obviously a thing for you to decide. I can say that I will try to help maintain it no matter where it lives.

sbinet added a commit to sbinet-gonum/plot that referenced this issue Jan 18, 2022
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jan 18, 2022
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jan 19, 2022
sbinet added a commit that referenced this issue Jan 19, 2022
Fixes #687.
Fixes #645.
Fixes #559.

Signed-off-by: Sebastien Binet <[email protected]>
sbinet added a commit to sbinet-gonum/plot that referenced this issue Oct 22, 2024
[email protected] has a better handling of points' closeness.
see:
https://git.sr.ht/~sbinet/gg/commit/1994be2d12593293d38a10764df23880fee6f436

It's a better fix for gonum#687

Signed-off-by: Sebastien Binet <[email protected]>
sbinet added a commit to sbinet-gonum/plot that referenced this issue Oct 22, 2024
sbinet added a commit to sbinet-gonum/plot that referenced this issue Oct 22, 2024
sbinet added a commit that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants