How can I place the plot in front of the axes?

Trying to produce a plot n vs. % duty cycle. Duty cycle is of course limited to the range 0…100%, so I want my plot to start at 0.

Unfortunately, my code makes the axes hide the point at (0,0):

Is it possible to arrange the plot in front of the axes?

This is my code:

#import "@preview/lilaq:0.6.0" as lq
#import "@preview/tiptoe:0.4.0"

#show lq.selector(lq.diagram): set text(
  size: .8em,
  font: "Arial"
  )

#align(center,
lq.diagram(
  width: 70%,
  height: 30%,
  // spine: (stroke: none),
  title: "Transfer curve",
  xlabel: "Set point [%]",
  ylabel: "n [rpm]",
  yaxis: (
    exponent: none,
    tip: tiptoe.stealth,
    mirror: false,
    lim: (0, auto),
    ),
  xaxis: (
    exponent: none,
    // tip: tiptoe.stealth,
    mirror: false,
    lim: (0, 100),
    ),

  lq.plot(
    (0,1,20,80,100), 
    (0,625,625,2500,2500),
    mark: none,
    stroke: (2pt),
    )
))

If i get it correctly just change the xaxis lim to somsig like lim: (-1,100). And you can try inverting the tiks from this tutorial Tick configuration − Lilaq, also there is answer to your other question. Hope it helps

1 Like

Nope. Doesn’t work.

-1% helps displaying the plot, but does not exist as duty cycle.

inverting the ticks would help a little bit but the y axis would still be above the plot.

And with my other question: that’s why I am asking - It does not work like this.
Maybe, it is a bug?

Z-index plot − Lilaq. And the font is changed loke so How to change diagram font in lilaq - #3 by Mc-Zen

#import "@preview/lilaq:0.6.0" as lq
#import "@preview/zero:0.6.1": set-num

#set-num(math: false)
#set page(margin: 5mm, paper: "a4")

#show lq.selector(lq.diagram): set text(font: "Arial")

#let data_x = (0, 1)
#let data_y = (0, 1)

#lq.diagram(
  width: 100%,
  height: 100%,
  lq.plot(data_x, data_y),
)

for example

Yes, z-index works.

  lq.plot(
    (0,1,20,80,100), 
    (0,625,625,2500,2500),
    mark: none,
    stroke: (3pt),
    z-index: 2090,
  )

However, it still looks a little bit ugly, as the plot line is cut by the plot area.

I have to take a closer look on how this is displayed as of now in excel and how it would be sensible.

We should better not mix up the Z-index thing and setting the font item. I believe they are two different things. That’s also why I made two separate threads for them.

This is how excel draws a very similar plot as of now:

I think we are able to recreate his using lilaq.

Is this same dataset? Anyway just removing tick lines and making the diagram border light gray, and maybe thinner, should do the thing. Also exel plot line looks thinner to

Tick configuration − Lilaq (seting inset and outset to 0)
Or Axis configuration − Lilaq the last examlpe

Hi!

In addition to increasing the z-index to make the plot appear above the axes, you can set clip: false to switch off clipping to the data area. See plot − Lilaq.

Although, Excel also applies clipping as it seems.

2 Likes

It’s not the same, just similar.

Yes, this is achievable using available formatting…

THANKS!

1 Like

You are right. clipping was the term I were missing.
However, this also looks somewhat odd, but exactly as I would have expected it to look:

Anyway, let’s see how we will style this in the end.
As already stated, we will manage to get a suitable result using this!

1 Like