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

How to set numeric tick interval? #1994

Open
vwkd opened this issue Feb 14, 2024 · 0 comments
Open

How to set numeric tick interval? #1994

vwkd opened this issue Feb 14, 2024 · 0 comments

Comments

@vwkd
Copy link

vwkd commented Feb 14, 2024

Description

According to the types, tick can be a RangeInterval which can be a number defining the tick interval.

a number (for number intervals), defining intervals at integer multiples of n

However, this conflicts with another type of tick which can be a number defining the tick amount.

From testing, it seems setting tick to a number is always interpreted as tick amount.

How can I set a numeric tick interval?

Steps To Reproduce

const data = [
  {x: 0, y: 0},
  {x: 1, y: 1},
  {x: 2, y: 2},
  {x: 3, y: 3},
  {x: 4, y: 4},
  {x: 5, y: 5},
]

Plot.plot({
  x: {
    ticks: 1
  },
  marks: [
    Plot.line(data, { x: "x", y: "y" })
  ]
})

Expected Result

Tick interval of 1, i.e. tick amount of 5.

tick_interval2

Actual Result

Tick amount of 1, i.e. tick interval of 5.

tick_interval

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

1 participant