Rotating Cartesian axes #594
-
I have created the following plot in |
Beta Was this translation helpful? Give feedback.
Answered by
johannes-wolf
May 18, 2024
Replies: 1 comment 1 reply
-
You can just use #import "@preview/cetz:0.2.2": canvas, draw
#set page(width: auto, height: auto, margin: .5cm)
#canvas({
import draw: *
set-style(mark: (length: .1, width: .2))
line((-2, 0), (2, 0), mark: (end: "barbed"))
line((0, -2), (0, 2), mark: (end: "barbed"))
line((0,1), (1,1), (1,0), stroke: (dash: "dashed"))
line((0,0), (1,1), mark: (end: "barbed"), stroke: red)
group({
rotate(30deg)
stroke(blue)
line((-2, 0), (2, 0), mark: (end: "barbed"))
line((0, -2), (0, 2), mark: (end: "barbed"))
})
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
psads-git
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can just use
rotate(<angle>)
to rotate around the z-axis (or any axis if you specify the axis name as named parameter).Example: