There are some style options in the axes
dictionary for that, which you can adjust:
-
padding
– How much the axis lines should reach outside the plot area on both sides. You can see this in your image, where the line goes outside the grid on the left and bottom. By default, it is set to0.1cm
. -
overshoot
– Basically the same aspadding
, but only for the side with the arrow head (i.e. on the right or top). This value is added to thepadding
value, and defaults to0.5cm
. -
mark
– Some style options to change the appearance of the arrow head. For example, you can make it smaller by changing thelength
orwidth
. You can find more about mark styling in the documentation of CeTZ.
In total, that might then look like this:
#canvas({
import draw: *
set-style(
axes: (
padding: 0pt,
overshoot: 6pt,
mark: (length: 3pt)
...
),
...
)
plot.plot(...)
})