You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
density is documented as expecting datalimits to be a 2-tuple, e.g., density(datalimits=(0,10)). However, when you go to plot the data with draw(plt), that leads to the error ERROR: BoundsError: attempt to access Int64 at index [2]. The way to get density to work is to actually wrap that 2-tuple in a 1-tuple: density(datalimits=((0,10),)).
using Random
using AlgebraOfGraphics
using AlgebraOfGraphics: density
using CairoMakie
CairoMakie.activate!()
df = (; x=randn(5000), y=randn(5000))
plt =data(df) *mapping(:x) *density(; datalimits=(-2.5, 2.5))
draw(plt)
The solution is to replace (-2.5, 2.5) with ((-2.5, 2.5),)
Bug description
density
is documented as expectingdatalimits
to be a 2-tuple, e.g.,density(datalimits=(0,10))
. However, when you go to plot the data withdraw(plt)
, that leads to the errorERROR: BoundsError: attempt to access Int64 at index [2]
. The way to getdensity
to work is to actually wrap that 2-tuple in a 1-tuple:density(datalimits=((0,10),))
.Might be related to #472?
Steps to reproduce
The solution is to replace
(-2.5, 2.5)
with((-2.5, 2.5),)
Error reporting
Images
Desired plot:
Version info
The text was updated successfully, but these errors were encountered: