draw curved lines with tikz

📅 March 12, 2024   |   👁️ Views: 104




Votre navigateur ne supporte pas les PDFs. Voir le Lien de Téléchargement au dessous .

\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{pgfplots}
\usetikzlibrary{calc}

\pgfplotsset{compat=1.18}
\pgfplotsset{
  standard/.style={
    axis line style = thick,
    trig format=deg,
    axis x line=middle,
    axis y line=middle,
    enlarge x limits=0.15,
    enlarge y limits=0.15,
    every axis x label/.style={at={(current axis.right of origin)},anchor=north west},
    every axis y label/.style={at={(current axis.above origin) },anchor=south east},
    grid=both,
    grid style=dashed,
    ticklabel style={font=\tiny, fill=white}
  }
}
\begin{document}
\begin{tikzpicture}
      \begin{axis}[standard,
          xtick={-2,-1,...,4},
          ytick={-1,0,...,3},
          xticklabel={\pgfmathprintnumber{\tick}},
          yticklabel={\pgfmathprintnumber{\tick}},
          xmin=-2, xmax=4.3,
          ymin=-1, ymax=3.3]

          \node[below left] at (axis cs:0,0){$O$};
          \draw[red, thick, looseness=0.3]
          (-2,0) to[out=65,in=180] (-1,3) to[out=0,in=180] (1,-1)
          to[out=0,in=-120] (2,3) -- (4,1);
      \end{axis}
\end{tikzpicture}
\end{document}




Related Courses, Exams, and Exercises


Course PDF:

📥 Download draw curved lines with tikz (PDF)