我怎样才能绘制内存图?

我怎样才能绘制内存图?

在此处输入图片描述

它不需要包含所有的颜色,但是有办法吗?

答案1

我用手指用一种名为马查

%% Compile and read me!
\documentclass[a4paper,12pt]{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,458); %set diagram left start at 0, and has height of 458

%Straight Lines [id:da3819310486316536] 
\draw [color={rgb, 255:red, 106; green, 135; blue, 28 }  ,draw opacity=1 ][line width=1.5]    (285.47,178.87) -- (285.47,232.8) ;
%Straight Lines [id:da9196171290801862] 
\draw [color={rgb, 255:red, 146; green, 194; blue, 240 }  ,draw opacity=1 ][line width=1.5]    (155,178.87) -- (155,198.27) -- (279.47,198.27) -- (279.47,232.8) ;
%Straight Lines [id:da8123020966558465] 
\draw [color={rgb, 255:red, 58; green, 82; blue, 23 }  ,draw opacity=1 ][line width=1.5]    (488,178.87) -- (488,198.27) -- (291.47,198.27) -- (291.47,231.8) ;
%Rounded Rect [id:dp8331577108926491] 
\draw  [color={rgb, 255:red, 98; green, 98; blue, 98 }  ,draw opacity=1 ][fill={rgb, 255:red, 58; green, 82; blue, 23 }  ,fill opacity=1 ][line width=1.5]  (404.47,119.99) .. controls (404.47,111.78) and (411.12,105.13) .. (419.32,105.13) -- (499.61,105.13) .. controls (507.82,105.13) and (514.47,111.78) .. (514.47,119.99) -- (514.47,164.55) .. controls (514.47,172.75) and (507.82,179.4) .. (499.61,179.4) -- (419.32,179.4) .. controls (411.12,179.4) and (404.47,172.75) .. (404.47,164.55) -- cycle ;
%Rounded Rect [id:dp9142460310149823] 
\draw  [color={rgb, 255:red, 98; green, 98; blue, 98 }  ,draw opacity=1 ][fill={rgb, 255:red, 146; green, 194; blue, 240 }  ,fill opacity=1 ][line width=1.5]  (100,118.85) .. controls (100,110.65) and (106.65,104) .. (114.85,104) -- (195.15,104) .. controls (203.35,104) and (210,110.65) .. (210,118.85) -- (210,163.41) .. controls (210,171.62) and (203.35,178.27) .. (195.15,178.27) -- (114.85,178.27) .. controls (106.65,178.27) and (100,171.62) .. (100,163.41) -- cycle ;
%Rounded Rect [id:dp31833772799392634] 
\draw  [color={rgb, 255:red, 98; green, 98; blue, 98 }  ,draw opacity=1 ][fill={rgb, 255:red, 106; green, 135; blue, 28 }  ,fill opacity=1 ][line width=1.5]  (251,118.85) .. controls (251,110.65) and (257.65,104) .. (265.85,104) -- (346.15,104) .. controls (354.35,104) and (361,110.65) .. (361,118.85) -- (361,163.41) .. controls (361,171.62) and (354.35,178.27) .. (346.15,178.27) -- (265.85,178.27) .. controls (257.65,178.27) and (251,171.62) .. (251,163.41) -- cycle ;
%Shape: Rectangle [id:dp8385696727824026] 
\draw  [draw opacity=0][fill={rgb, 255:red, 255; green, 127; blue, 0 }  ,fill opacity=1 ][line width=1.5]  (170.47,104.6) -- (188.47,104.6) -- (188.47,177.27) -- (170.47,177.27) -- cycle ;
%Shape: Rectangle [id:dp3328859475054815] 
\draw  [draw opacity=0][fill={rgb, 255:red, 255; green, 127; blue, 0 }  ,fill opacity=1 ] (145,105.13) -- (163.47,105.13) -- (163.47,177.13) -- (145,177.13) -- cycle ;
%Rounded Rect [id:dp6815758228230662] 
\draw  [color={rgb, 255:red, 98; green, 98; blue, 98 }  ,draw opacity=1 ][fill={rgb, 255:red, 72; green, 125; blue, 174 }  ,fill opacity=1 ][line width=1.5]  (117,247.32) .. controls (117,239.41) and (123.41,233) .. (131.32,233) -- (365.15,233) .. controls (373.06,233) and (379.47,239.41) .. (379.47,247.32) -- (379.47,290.28) .. controls (379.47,298.19) and (373.06,304.6) .. (365.15,304.6) -- (131.32,304.6) .. controls (123.41,304.6) and (117,298.19) .. (117,290.28) -- cycle ;
%Shape: Rectangle [id:dp3550282553763453] 
\draw  [draw opacity=0][fill={rgb, 255:red, 255; green, 127; blue, 0 }  ,fill opacity=1 ] (275.77,105.13) -- (294.23,105.13) -- (294.23,177.13) -- (275.77,177.13) -- cycle ;
%Shape: Rectangle [id:dp12346436338171785] 
\draw  [draw opacity=0][fill={rgb, 255:red, 255; green, 127; blue, 0 }  ,fill opacity=1 ] (477.47,104.27) -- (495.47,104.27) -- (495.47,180.27) -- (477.47,180.27) -- cycle ;
%Shape: Rectangle [id:dp4109571698402479] 
\draw  [draw opacity=0][fill={rgb, 255:red, 255; green, 127; blue, 0 }  ,fill opacity=1 ] (276.5,233.27) -- (295.47,233.27) -- (295.47,304.27) -- (276.5,304.27) -- cycle ;
%Straight Lines [id:da029596985363378625] 
\draw [color={rgb, 255:red, 146; green, 194; blue, 240 }  ,draw opacity=1 ][line width=1.5]    (182,178.87) -- (182,198.27) ;

% Text Node
\draw (110,76.87) node [anchor=north west][inner sep=0.75pt]   [align=left] {{\fontfamily{lmr}\selectfont \textbf{\textcolor[rgb]{0.57,0.76,0.94}{VM RAM}}}};
% Text Node
\draw (260,76.87) node [anchor=north west][inner sep=0.75pt]   [align=left] {{\fontfamily{lmr}\selectfont \textbf{\textcolor[rgb]{0.42,0.53,0.11}{VM RAM}}}};
% Text Node
\draw (420,76.87) node [anchor=north west][inner sep=0.75pt]   [align=left] {{\fontfamily{lmr}\selectfont \textbf{\textcolor[rgb]{0.23,0.32,0.09}{VM RAM}}}};
% Text Node
\draw (161,307.87) node [anchor=north west][inner sep=0.75pt]  [font=\Large] [align=left] {{\fontfamily{lmr}\selectfont \textbf{\textcolor[rgb]{0.31,0.31,0.31}{Hardware RAM}}}};


\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容