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

Manual ticks not working properly in log mode #94

Open
SolidTux opened this issue Nov 25, 2024 · 2 comments
Open

Manual ticks not working properly in log mode #94

SolidTux opened this issue Nov 25, 2024 · 2 comments
Labels
👿 bug Something isn't working

Comments

@SolidTux
Copy link

In log mode, the manual ticks seem to be not working properly.

Document

#import "@preview/cetz-plot:0.1.0": plot
#import "@preview/cetz:0.3.1"

#set page(width: auto, height: auto, margin: 5mm)

#cetz.canvas(
  {
    plot.plot(
      size: (6, 3),
      x-min: -0.5,
      y-mode: "log",
      y-format: "sci",
      y-min: 1e-6,
      y-max: 1e-1,
      y-ticks: range(10)
        .map(x => x * 1e-2)
        .map(x => (x, move(dx: 2.5em, repr(x)))),
      y-tick-step: 1,
      {
        plot.add((
          (0, 1e-5),
          (1, 1e-4),
          (2, 1e-2),
        ),
          mark: "o"
        )
      }
    )
  }
)

2024-11-25 plot ticks

@johannes-wolf johannes-wolf added the 👿 bug Something isn't working label Nov 25, 2024
@jamesrswift
Copy link
Collaborator

Can you elaborate on what isn't working properly?

@SolidTux
Copy link
Author

SolidTux commented Dec 2, 2024

The value of the elements of y-ticks do not correspond to the value they belong to. See how 0.08 is placed at the location of 1e-2? Here is a similar example with a linear axis. Ticks are placed where they should, meaning that a value of 0.02 in the y-tick array corresponds to a y-value of 0.02 and not something else.

The labels on the outside are the automatic ticks and the ones inside the manual ones.

2024-11-25 plot ticks

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

No branches or pull requests

3 participants