Skip to content

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
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!

Log

If your data is following, you can plot points

py
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
jscatter.plot(
  x=np.random.rand(500),
  y=np.random.rand(500),
  x_scale='pow',
)