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

Making x-grid great again #355

Merged
merged 2 commits into from
Nov 25, 2023
Merged

Making x-grid great again #355

merged 2 commits into from
Nov 25, 2023

Conversation

dscso
Copy link
Contributor

@dscso dscso commented Nov 25, 2023

When updating from 1.2 to 2.0 x-grid doesn't work anymore. Here a practical example:

canvas({
    import draw: *

    plot.plot(
        size: (8,6),
        x-grid: true,
        y-grid: true,
        {
            plot.add(domain: (0, 2*calc.pi), calc.sin, label: $ sin x $)
            plot.add(domain: (0, 2*calc.pi), calc.cos, label: $ cos x $)
        }
    )
})

image

before

after this pull request
image

These are the tests that are different due to the change of this commit:
https://github.com/johannes-wolf/cetz/blob/master/tests/chart/ref.png
https://github.com/johannes-wolf/cetz/blob/0.2.0/tests/chart/ref.png
and
https://github.com/johannes-wolf/cetz/blob/master/tests/plot/ref.png
https://github.com/johannes-wolf/cetz/blob/0.2.0/tests/plot/ref.png
and
https://github.com/johannes-wolf/cetz/blob/master/tests/axes/ref.png
https://github.com/johannes-wolf/cetz/blob/0.2.0/tests/axes/ref.png

This pull request does fix this issue of the x-grid missing. All tests work except the three above mentioned.

@johannes-wolf johannes-wolf added bug 🐛 Something isn't working lib:plot labels Nov 25, 2023
@johannes-wolf
Copy link
Member

johannes-wolf commented Nov 25, 2023

Can you submit the updated test images by running just update-test?
If not, I'll do that in a later PR.

@johannes-wolf johannes-wolf linked an issue Nov 25, 2023 that may be closed by this pull request
@johannes-wolf johannes-wolf merged commit 4405e1d into cetz-package:0.2.0 Nov 25, 2023
1 check passed
@johannes-wolf
Copy link
Member

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working lib:plot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add legends to cetz.plot
2 participants