当前位置:首页 > 使用样例 > 绘图

plot with pgfplots
上传时间:2025-03-21 09:27:06
  • plot with pgfplots
作品简介

\documentclass[10pt]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{col1}{rgb}{0.4,0.4,0.4} \definecolor{col2}{rgb}{0,0.39215686274509803,0} \begin{center} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=2cm,y=2cm] \begin{axis}[ x=1cm,y=1cm, axis lines=middle, ymajorgrids=true, xmajorgrids=true, xmin=-1.46, xmax=4.48, ymin=-4.01, ymax=4.96, xtick={--1,0,...,4}, ytick={-4,-3,...,4},] \clip(-7.46,-5.01) rectangle (7.48,4.96); \draw[line width=2pt,color=col1,smooth,samples=100,domain=-1.46:4.48] plot(\x,{(\x)^(2)*((\x)-3)}); \draw[line width=2pt,color=col2,smooth,samples=100,domain=-1.46:4.48] plot(\x,{((\x)-3/2)^(2)-2.25}); \begin{scriptsize} \draw[color=col1] (-0.89,-4.75) node {$f$}; \draw[color=col2] (-0.98,4.9) node {$g$}; \end{scriptsize} \end{axis} \end{tikzpicture} \end{center} \end{document}

暂无评论

  •  506
  •  0
  •  1
  • 作  者: achour 关注 已关注
  • 测试平台:texlive
  • 编译方式:xelatex
  • 源码属性:原创