我有一个如下图所示的图形。我想用 LaTeX 绘制它。但我应该在其中上传一个图形。你能帮我吗?
这是我的代码:
\begin{tikzpicture}[
mycirclestyle/.style={draw,fill=blue!30,square, minimum size=1.5cm,inner sep=1pt},
myarrowstyle/.style={stealth-,
line width=2mm,
draw=gray!40,}
]
\node[mycirclestyle, name=circle] at (0,0) {\textbf{A conversion}};
\foreach \direction/\angle/\anchordir/\ttext in { south/-90/north/\shortstack{fig1}, west/-180/east/ \shortstack{fig2}}
{\draw[myarrowstyle](circle.\direction)--++(\angle:1cm)node[anchor=\anchordir]{\ttext};}
\end{tikzpicture}
答案1
这应该会给你正确的结果。只需确保fig1
&fig2
位于该文件所在的同一目录中即可。
\documentclass[tikz]{standalone}
\usetikzlibrary{shapes}
\usepackage{graphicx}
\begin{document}
\begin{tikzpicture}[
mycirclestyle/.style={draw,fill=blue!30,minimum size=1.5cm,inner sep=1pt},
myarrowstyle/.style={stealth-,
line width=2mm,
draw=gray!40,}
]
\node[mycirclestyle, name=circle] at (0,0) {\textbf{A conversion}};
\foreach \direction/\angle/\anchordir/\ttext in {south/-90/north/\shortstack{\includegraphics{fig1}}, west/-180/east/\shortstack{\includegraphics{fig2}}}
{\draw[myarrowstyle](circle.\direction)--++(\angle:1cm) node[anchor=\anchordir]{\ttext};}
\end{tikzpicture}
\end{document}