내 라텍스 파일에 아래 그림을 어떻게 추가할 수 있나요?

내 라텍스 파일에 아래 그림을 어떻게 추가할 수 있나요?

라텍스 파일에 추가하고 싶은 이미지가 있습니다: 여기에 이미지 설명을 입력하세요

내 MWE는 다음과 같습니다.

\usepackage{graphicx}

\usepackage{amssymb,amsthm}

\usepackage{natbib}

\bibpunct{(}{)}{;}{;}{,}{,}

\usepackage{xr-hyper}

\usepackage[
  colorlinks=true,
  citecolor=blue,
  urlcolor=blue,
  linkcolor=blue
]{hyperref}

\usepackage{bm}

\usepackage{fullpage}

\usepackage{ amssymb }

    \pagestyle{plain}

\setlength{\parskip}{\baselineskip}
\setlength{\parindent}{0pt}

\setcounter{secnumdepth}{2}

\allowdisplaybreaks[4]

% Commenting/debugging
\let\IG\iffalse
\let\ENDIG\fi

%% Shortcuts
\newcommand{\td}[2]{\dfrac{d #1}{d #2}}
\newcommand{\std}[2]{\dfrac{d^2 #1}{d {#2}^2}}
\newcommand{\ctd}[3]{\dfrac{d^2 #1}{d #2 d #3}}

\newcommand{\pd}[2]{\dfrac{\partial #1}{\partial #2}}
\newcommand{\spd}[2]{\dfrac{\partial^2 #1}{\partial {#2}^2}}
\newcommand{\cpd}[3]{\dfrac{\partial^2 #1}{\partial #2 \partial #3}}

\newcommand{\pdi}[2]{\partial #1/\partial #2}

\newcommand{\LR}{\Leftrightarrow}
\newcommand{\Lg}{\mathcal{L}}
\newcommand{\half}{\tfrac{1}{2}}
\newcommand{\eqp}{\phantom{=}}
\newcommand{\eqs}{\buildrel s \over =}

\begin{document}
\end{document}

나는 또한 그림에 라벨을 붙이고 싶다.

답변1

\usepackage{tikz}서문에 추가하세요 .

그런 다음 그림을 원하는 위치에 다음 코드를 삽입하십시오.

\begin{figure}
\begin{tikzpicture}
%axis
\draw (12,0) -- (0,0)--(0,10);
% Blue lines
\draw[blue] (0,9)node[left]{\color{black}20} -- (11,0)node[below]{\color{   black}12}node[near end,right]{\color{black}$MC_2$};
\draw[blue] (0,9) -- (9,0)node[below]{\color{black}10}node[near end,left]{  \color{black}$MC_1$};
% Red lines
\draw[red] (0,1) -- (5,10)node[near end,right]{\color{black}$MB_1$};
\draw[red] (0,0.5) -- (8,10)node[near end,right]{\color{black}$MB_2$};
% Dotted lines
\draw[dotted,thick] (2.85,0)node[below]{$I^*$} -- (2.85,6.1)--(0,6.1)node[  left]{$U(I^*)$};
\draw[dotted,thick] (4.25,0)node[below]{$I$} -- (4.25,5.53)--(0,5.53)node[  left]{$U(I)$};
\draw (0,0)node[below]{0}node[left]{0};
\end{tikzpicture}
%Figure caption
\caption{Demo of TikZ Figure}
\end{figure}

아래 그래프를 생성하려면

그라프

관련 정보