我需要制作一个图表,左侧有不同的发射天线,右侧有一个接收器块。对于接收器,我需要多个天线。我可以获得一个天线,如何获得多个天线?
(0,-1.5)
其次我想要从 坐标的天线到 的虚线(0,3)
。我写的代码如下:
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{amssymb}
\usepackage{amsthm}
%\usepackage{caption}
\usepackage{cite}
\usepackage{subfigure}
\usepackage{enumerate}
\usepackage{tikz}
\usepackage{cite}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes,arrows}
\usepackage{verbatim}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{patterns}
\usepackage{relsize}
\usepackage{anyfontsize}
\usepackage{t1enc}
%\documentclass[tikz,border=5mm]{standalone}
\usepackage{ellipsis}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing,decorations.markings,shapes.geometric}
\usepackage{circuitikz}
\tikzset{block/.style = {draw, fill=white, rectangle,
minimum height=16em, minimum width=2cm},
input/.style = {coordinate},
output/.style = {coordinate},
pinstyle/.style = {pin edge={to-,t,black}}
}
\begin{document}
% Radius of regular polygons
\newdimen\R
\R=0.8cm
\begin{tikzpicture}
%####################################################################
%#################### BASE STATIONS
\node (an1) at ($(0,0)$) {\includegraphics[scale=0.010]{bs.eps}};
\node (an2) at ($(0,-0.5)$) {\includegraphics[scale=.010]{bs.eps}};
\node (an2) at ($(0,0.5)$) {\includegraphics[scale=.010]{bs.eps}};
\node (an2) at ($(0,1)$) {\includegraphics[scale=.010]{bs.eps}};
\node (an2) at ($(0,-3)$) {\includegraphics[scale=.010]{bs.eps}};
\node[block,right = 10cm of an1](rx){receiver};
\node[antenna,xscale=-1] at (rx.west) {};
\end{tikzpicture}
\end{document}
答案1
开始吧。两张图片定义了接收器和每个发射器天线。一个foreach
循环在发射器和接收器之间画出箭头。最好忘记foreach
并单独绘制每条路径,以便更好地放置此处未显示的标签。
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{positioning, shapes.geometric}
\tikzset{
tx/.pic={
\node[isosceles triangle, draw, inner sep=0pt, shape border rotate=90, minimum height=0.5cm] (-tx){};
\draw ([shift={(.1,.1)}]-tx.north) arc[start angle=0, end angle=-180, radius=1mm];
\draw ([shift={(.05,.1)}]-tx.north) arc[start angle=0, end angle=-180, radius=0.5mm];
},
rx/.pic={
\node[minimum width=3cm, minimum height=5cm, draw] (-rx) {Receiver};
\foreach \i in {1,2,3,5}
\draw ([yshift=-\i cm+0.5cm]-rx.north west)--++(180:3mm) coordinate (-\i-rx)--++(90:3mm)--++(2mm,3mm)--++(-4mm,0mm)--++(2mm,-3mm);
\path (-3-rx)--(-5-rx) node[pos=.25] {\vdots};
}
}
\begin{document}
\begin{tikzpicture}
\pic (R) {rx};
\foreach \i in {1, 2, 3, 5}
{
\pic (\i) at ([xshift=-3cm]R-\i-rx) {tx};
}
\path (3-tx)--(5-tx) node[pos=.25]{\vdots};
\foreach \i in {1,2,3,5}
\foreach \j in {1,2,3,5}
\draw[shorten >=2mm, shorten <=2mm,->] (\i-tx.north)--(R-\j-rx);
\end{tikzpicture}
\end{document}