Plot of which diverges at .
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel = $z$,
smooth,thick,
axis lines = center,
every tick/.style = {thick},
legend pos=north west]
\addplot[color=blue,domain=0:1.1,samples=150]{-ln(1-x)};
\legend{$-\ln(1 - z)$}
\end{axis}
\end{tikzpicture}
\end{document}
#import "@preview/cetz:0.3.4": canvas, draw
#import "@preview/cetz-plot:0.1.1": plot
#set page(width: auto, height: auto, margin: 8pt)
#canvas({
draw.set-style(
axes: (
y: (mark: (end: "stealth", fill: black, scale: 0.5)),
x: (mark: (end: "stealth", fill: black, scale: 0.5)),
),
)
plot.plot(
size: (8, 5),
x-label: $z$,
x-max: 1.1,
x-tick-step: 0.5,
y-tick-step: 2,
axis-style: "left",
legend: "inner-north-west",
legend-style: (item: (spacing: 0.2), padding: 0.15, stroke: .5pt),
{
plot.add(
style: (stroke: blue + 1.5pt),
domain: (0, 0.999), // avoid x=1 since ln(0) is undefined
samples: 150,
label: $-ln(1-z)$,
x => -calc.ln(1 - x),
)
},
)
})