题库
试卷
组卷
图库
知识
抛物线
核心代码解释:
抛物线方程 y=x^2, 其中定义域x的取值为[-2,2]
\documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{positioning, calc} \begin{document} \begin{tikzpicture} \draw[->] (-4,0) -- (4,0) node[below] {$x$}; %作x轴并标上字母 \draw[->] (0,-1) -- (0,6) node[left] {$y$}; %作y轴并标上字母 \node[below left] at (0,0) {$O$}; %标上原点字母 \draw [domain=-2:2] plot (\x, { pow(\x,2)} ); % y=x^2 \end{tikzpicture} \end{document}