-
Beta Was this translation helpful? Give feedback.
Answered by
TheJanzap
Jun 27, 2026
Replies: 1 comment 1 reply
-
|
Maybe: does what you expect: #import "@preview/cetz:0.5.2": *
#import "@preview/cetz-plot:0.1.4": *
#let horizontal-throw(scaling: 1) = {
canvas({
import draw: *
import calc: pow
let g = 9.81
let v_0 = 10
let h = 5
set-style(
stroke: (thickness: 0.1em),
mark: (length: 0.7em, width: 0.4em),
axes: (tick: (stroke: 0.1em, length: 0.5em))
)
scale(scaling)
set-style(content: (auto-scale: true), mark: (transform-shape: true))
plot.plot(
size: (5, 6),
y-label: $h$,
axis-style: "left",
{
plot.add(domain: (0, 10.1), x => -g/2 * pow(x/v_0, 2) + h)
})
})
}
#horizontal-throw()
#horizontal-throw(scaling: 0.6) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

It does work quite well when the scaling is applied with
scaling()and not tocanvas: length. However I removedcontent: (auto-scale: true)as that was making the axis text illegibly small.Here is my final code