---
url: /scales.md
description: How to customize the X and Y scales.
---

# Scales

In the following we'll go over all supported X/Y scale functions.

::: info
We'll add support for more scale functions in the future, so make sure to check
back from time to time.
:::

## Linear

By default, points are plotted linearly along the x and y coordinate.

```py
jscatter.plot(x=np.random.rand(500), y=np.random.rand(500))
```

## Time

While technically identical to linear scaling, if you have temporal data, you
can render out axes with nice tick marks by setting the X or Y scale to `time`.

```py{8}
jscatter.plot(
  x=np.random.randint(
    low=1672549200000, # Jan 1, 2023 00:00:00
    high=1704085200000, # Jan 1, 2024 00:00:00
    size=500
  ),
  y=np.random.rand(500),
  x_scale='time',
)
```

::: warning
For the time scale to work, the data needs to be in the form of [timestamps given as the number of milliseconds since the beginning of the Unix epoch](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date)!
:::

## Log

If your data is following, you can plot points

```py{4}
jscatter.plot(
  x=np.random.rand(500),
  y=np.random.rand(500),
  x_scale='log',
)
```

## Power

Similarly, you can also plot points according to a power scale along the x or y
axis.

```py{4}
jscatter.plot(
  x=np.random.rand(500),
  y=np.random.rand(500),
  x_scale='pow',
)
```
