如何绘制此图像以及如何在绘图中放置文本?请尽快帮助提供代码

如何绘制此图像以及如何在绘图中放置文本?请尽快帮助提供代码

在此处输入图片描述

我是这个方面的新手,我真的需要帮助来在 Latex 中绘制它。

答案1

请在问题中再次使用 never ASAP。

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
 \draw[thin] foreach \X in {0.1,0.2,...,4.9}
  {(\X,0) -- (\X,0.2)};
 \draw[thin] foreach \X in {0.5,1,...,4.5}
  {(\X,0) -- (\X,0.3)}; 
 \draw (0,0)  -- (5,0) foreach \X in {0,1,...,5}
  {(\X,0) -- (\X,0.5) node[above]{\ifnum\X=0\relax \textsc{CM}\else $\X$  \fi}};
 \draw (1,2) rectangle (3.5,3) node[midway] {text}
  foreach \X in {1.5,3} {(\X,1.6) node[circle,fill,inner sep=2pt] {}circle[radius=0.35cm]};
 \draw[-latex] (1,3) -- (0,3.5);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

https://www.mathcha.io/

\documentclass{article}

\usepackage{tikz}

\begin{document}




\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Rectangle [id:dp48852170770045333] 
\draw   (100,125) -- (282,125) -- (282,165) -- (100,165) -- cycle ;
%Shape: Circle [id:dp7086230022754691] 
\draw   (100,192.5) .. controls (100,183.39) and (107.39,176) .. (116.5,176) .. controls (125.61,176) and (133,183.39) .. (133,192.5) .. controls (133,201.61) and (125.61,209) .. (116.5,209) .. controls (107.39,209) and (100,201.61) .. (100,192.5) -- cycle ;
%Shape: Circle [id:dp15885146101790903] 
\draw   (245,193.5) .. controls (245,184.39) and (252.39,177) .. (261.5,177) .. controls (270.61,177) and (278,184.39) .. (278,193.5) .. controls (278,202.61) and (270.61,210) .. (261.5,210) .. controls (252.39,210) and (245,202.61) .. (245,193.5) -- cycle ;
%Shape: Circle [id:dp6188324583058722] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (111,192.5) .. controls (111,189.46) and (113.46,187) .. (116.5,187) .. controls (119.54,187) and (122,189.46) .. (122,192.5) .. controls (122,195.54) and (119.54,198) .. (116.5,198) .. controls (113.46,198) and (111,195.54) .. (111,192.5) -- cycle ;
%Shape: Circle [id:dp6268195745331264] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (256,193.5) .. controls (256,190.46) and (258.46,188) .. (261.5,188) .. controls (264.54,188) and (267,190.46) .. (267,193.5) .. controls (267,196.54) and (264.54,199) .. (261.5,199) .. controls (258.46,199) and (256,196.54) .. (256,193.5) -- cycle ;
%Straight Lines [id:da6035408403138598] 
\draw    (100,128) -- (45.23,57.58) ;
\draw [shift={(44,56)}, rotate = 412.13] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;


% Text Node
\draw (191,145) node  [align=left] {text};


\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容