Skip to content

Transform the axes label text together with other elements #1047

@hexiongwu1995

Description

@hexiongwu1995

Hello, friends.

Regarding the Typst code snippet below. I used the anchor arguments to specify all the axes label's position. But the position of y axes label is overlapped with the y axis. I am not sure if this issue stem from the transform function ortho(). I am wondering if there is a method to transform the label text together with the other elements? Please provide some advice. Thanks.

Image
#import "@preview/cetz:0.4.2"
#cetz.canvas({
import cetz.draw: *

ortho(x: 20deg, y: 20deg,z: 0deg, {
    // Draw a 3d isometric coordinate system
    let mark-style = (mark: (start: none, end: (symbol: "curved-stealth", fill: black)))
    line((0,0,0), (3,0,0), ..mark-style, name: "x")
    line((0,0,0), (0,3,0), ..mark-style, name: "y")
    line((0,0,0), (0,0,3), ..mark-style, name: "z")
    content("x.end", $x$, anchor: "west")
    content("y.end", $y$, anchor: "south")
    content("z.end", $z$, anchor: "north-east")
// Draw a rectangle in xz plane at y=0
  on-xz({ grid((-1,-1),(3,3),help-lines:true)
          rect((0, -1), (1, 1))  })
})

})

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions