关于乳胶图形的查询

关于乳胶图形的查询

在此处输入图片描述

你好,我是 Latex 的初学者,我的问题是,是否可以使用 Latex 绘制文件中给出的图形?

答案1

您的问题已在评论中得到解答;-)。因此,这并不是问题的确切答案,只是一些打字练习。:-)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{backgrounds,intersections}
\begin{document}
  \begin{tikzpicture}
    \draw[thick,latex-latex] (-2,0) -- (5,0)node[right]{$x$};
    \draw[thick,latex-latex] (0,-2) -- (0,5)node[above]{$y$};
    \node at (-0.2,-0.2) {O};
    \begin{scope}[on background layer]
    \fill[red!30,opacity=0.4] (-0.5,4.5) -| (4.5,-0.5) -- cycle;
    \end{scope}
    \node at (3,3.5) {$x + y - 4 \geq 0$};
    \foreach \x in {-1,1,2,3}{
     \node[fill,circle,inner sep=1.5pt,label=below:$\x$] at (\x,0) {};
     \node[fill,circle,inner sep=1.5pt,label=left:$\x$] at (0,\x) {};
     }
     \draw[thick,stealth-stealth, ] (-0.5,4.5) -- (4.5,-0.5) 
                                                        node[pos=0.5,below,sloped] {$x+y-4=0$};
     \foreach \x/\y in {1/3,3/1}{
      \node[fill,circle,inner sep=1.5pt,label={right:($\x, \y$)}] at (\x,\y) {};
      }
  \end{tikzpicture}

\begin{tikzpicture}
    \draw[thick,latex-latex] (-2,0) -- (6,0)node[right]{$x$};
    \draw[thick,latex-latex] (0,-2) -- (0,6)node[above]{$y$};
    \node at (-0.2,-0.2) {O};    
     \draw[thick,stealth-stealth, shorten >= -1cm, shorten <= -5mm,name path =a ] (0,5) -- (3,0)
                                                        node[pos=1.15,below] {$5x+3y-15=0$};
     \draw[thick,stealth-stealth, shorten >= -1cm, shorten <= -5mm,name path =b ] (0,4) -- (5,0)
                                                        node[pos=0.65,above,sloped] {$4x+5y-20=0$};
     \path [name intersections={of=a and b, by=c}];
     \foreach \x/\y/\pos in {0/5/right,5/0/{below left}}{
      \node[fill,circle,inner sep=1.5pt,label={[inner sep=0pt]\pos:($\x, \y$)}] at (\x,\y) {};
      }
      \foreach \x/\y/\name in {0/4/C,3/0/A}{
      \node[fill,circle,inner sep=1.5pt,label={[inner sep=0pt]below left:\name($\x, \y$)}] at (\x,\y) {};
      }
      \node[fill,circle,inner sep=1.5pt,label={right:$B\left(\frac{15}{13},\frac{40}{13}\right)$}] 
                  at (c) {};
      \begin{scope}[on background layer]
        \fill[blue!30!green,opacity=0.4] (c) -- (0,4) |- (3,0) -- cycle;
      \end{scope}
  \end{tikzpicture}

\end{document}

在此处输入图片描述

下次请付出一些努力并发布您尝试过的代码,这样我们就不需要从头开始。

相关内容