Skip to content

How to correctly annotate plots? #420

Answered by psads-git
psads-git asked this question in Q&A
Discussion options

You must be logged in to vote

After having struggled a bit, I was successful in producing the wanted plot, by using the code below:

#import "@local/cetz:0.2.0"

#align(center, 
  cetz.canvas({
    import cetz.plot
    import cetz.palette
    import cetz.draw: *

    plot.plot(size: (5,5),
      name: "plot",
      x-tick-step: 2,
      x-minor-tick-step: 1,
      y-tick-step: 6,
      y-minor-tick-step: 1,
      axis-style: "school-book", {
      plot.add(domain: (-2.5, 2.5),
        x => (4-calc.pow(x, 2)),
        style: palette.tango-light)
      plot.add(domain: (-2.5, 2.5),
        x => (4-2*x),
        style: palette.tango-light)
      plot.add-fill-between(domain: (0, 2),
        x => (4-calc.pow(x, 2)),
     …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@johannes-wolf
Comment options

Answer selected by johannes-wolf
Comment options

You must be logged in to vote
0 replies
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