Skip to content
Discussion options

You must be logged in to vote

It does work quite well when the scaling is applied with scaling() and not to canvas: length. However I removed content: (auto-scale: true) as that was making the axis text illegibly small.

Here is my final code

#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: 1.3em)),
    )

    scale(scaling)
    
    plot.plot(
      size: (7, 6),
      y-label: $h$,
      axis-style: "left",
      {
        plot.add(domain: (0, 10.1), x => -g/2 * pow(x/v_0, 2) + h)
    })
  }…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TheJanzap
Comment options

Answer selected by TheJanzap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants