\documentclass[12pt,a4,twoside]{article}
\usepackage{tikz}
\usetikzlibrary{shapes.misc,shapes.geometric,arrows.meta,positioning,shadows.blur,chains,scopes,quotes}
\begin{document}
\begin{figure}
\begin{tikzpicture}
[
->,
>=Stealth,
shorten >=1pt,
shorten <=1pt,
thick,
main node/.style={fill=white, draw, font=\sffamily\scriptsize\bfseries, blur shadow, align=center},
hex/.style={main node, rectangle},
ell/.style={main node, ellipse},
blur shadow={shadow opacity=25},
]
%Nodes
\node [ell] (maintopic) {Low Water Charges};
\node [ell] (wp) [left=of maintopic] {Water Pricing Policy};
\node [ell] (ec) [right=of maintopic] {\parbox[t][][t]{2.8cm}{{Environmental Consequences like Groundwater Depletion}}};
\node [hex] (lc) [below=of maintopic] {Low \textendash Cost Recovery};
\node [hex] (lw) [below=of wp] at (-3.5,-2.5) {\parbox[t][][t]{2.4cm}{{Low Willingness to Pay}}};
\node [hex] (if) [below=of ec] at (4.5,-2.5) {\parbox[t][][t]{2.4cm}{{Inability to Fund adequately O \& M}}};
\node [hex] (fd) [below=of lw] at (-3,-4.5) {Farmer Dissatisfaction};
\node [hex] (p) [below=of if] at (4,-4.5){Poor O \& M};
\node [hex] (pis) [below=of lc] at (0.1,-6.4) {Poor Irrigation Service};
\node [ell] (la) [below=of wp] at (-7,-2.5) {\parbox[t][][t]{2.4cm}{{Low ability to Pay}}};
\node [ell] (li) [below=of la] at (-6.5,-3.8) {Low Incomes};
\node [ell] (ly) [below=of li] at (-5,-5.5) {Low Yields};
\node [ell] (iae) [below=of ly] {\parbox[t][][t]{2.4cm}{{Inadequate Agricultural Extension}}};
\node [ell] (ic) [below=of pis] {Institutional Constraints};
\node [ell] (dpi) [right=of lc] at (3.8,-5) {\parbox[t][][t]{2.4cm}{{Decline in Public Investment}}};
\node [ell] (ld) [above=of dpi] at (8,-4.5) {\parbox[t][][t]{2.4cm}{{Low / Declining Priority in Planned Funds for Irrigation}}};
\node [hex] (ps) [right=of pis] at (0.9,-6.8) {\parbox[t][][t]{3cm}{{Poor Irrigation Systems}}};
%Lines
\draw[<-] (wp) -- (maintopic);
\draw[->] (maintopic) -- (ec);
\draw[->] (maintopic) -- (lc);
\draw[-] (lc.west) .. controls +(left:10mm) and +(up:15mm)
.. (lw.north);
\draw[-] (lc.east) .. controls +(right:7mm) and + (up:20mm) .. (if.north);
\draw[-] (lw.south) .. controls +(down:5mm) and +(left:5mm) .. (fd.north);
\draw[-] (if.south) .. controls +(down:5mm) and +(right:5mm) .. (p.north);
\draw[-] (fd.south) .. controls +(down:5mm) and +(left:5mm) .. (pis.west);
\draw[-] (p.south) .. controls +(down:5mm) and +(right:1mm) .. (ps.north);
\draw[-] (ps.west) .. controls +(down:5mm) and +(right:5mm) .. (pis.east);
\draw [-] (lc.west) .. controls +(left:20mm) and + (up:2mm) .. (la.north);
\draw[-] (la.south) .. controls +(down:5mm) and +(left:5mm) .. (li.north);
\draw[-] (li.south) .. controls +(down:5mm) and +(left:5mm) .. (ly.north);
\draw[-] (ly.south) .. controls +(down:5mm) and +(left:5mm) .. (pis.west);
\draw[-] (lc.east) .. controls +(right:15mm) and + (up:15mm) .. (dpi.north);
\draw[-> ,line width=0.8mm] (lc.southwest) .. controls +(right:10mm) and + (up:22mm) .. (dpi.north);
\draw[-] (dpi.south) .. controls +(down:5mm) and +(right:5mm) .. (ps.east);
\draw[-] (ps.south) .. controls +(down:5mm) and +(right:5mm) .. (pis.east);
\draw[->] (ic) -- (pis);
\draw[->] (iae) -- (ly);
\draw[->] (ld) -- (dpi);
\end{tikzpicture}
\end{figure}
\end{document}
我该如何纠正箭头的对齐?
答案1
正如我在评论中提到的那样,您的图像应该是什么样的并不完全清楚:
- 除了输入错误
southwest
->south west
- 您的图形太宽了,无法放入文本块中!它突出了页面边框(请参见代码图片,我只补充一点,
showframe
您可以看到页面布局)
(红线表示您的文档页面布局)
- 您设想如何将其放在页面上?旋转图形是可接受的解决方案吗?
上图的 MWE 为:
\documentclass[12pt,a4,twoside]{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{rotating}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
chains,
positioning,
quotes,
scopes, shadows.blur, shapes.geometric, shapes.misc}
\usepackage{copyrightbox}
\begin{document}
\begin{sidewaysfigure}[hp]
\centering
\copyrightbox[b]{
\noindent\begin{tikzpicture}[
node distance = 5mm and 4mm,
start chain = H going right,
arr/.style = {-Straight Barb, semithick},
base/.style = {draw, thick, font=\footnotesize\sffamily\bfseries,
fill=white, minimum height=3ex,
text width=7.5em, align=flush center,
outer sep=1mm, blur shadow={shadow opacity=30}},
E/.style = {ellipse, base, text width=6em, inner xsep=-3pt},
N/.style = {rectangle, base},
]
%Nodes
\begin{scope}[nodes={on chain=H}]
\node (n11) [E] {Water Pricing Policy};
\node (n12) [E] {Low Water Charges};
\node (n13) [E,text width=10em]
{Environmental Consequences like Groundwater Depletion};
\draw[arr] (n12) -- (n11);
\draw[arr] (n12) -- (n13);
\end{scope}
\node (n2) [N, below=of n12] {Low -- Cost Recovery};
\draw[arr] (n12) -- (n2);
%
\node (n311) [N, below left=of n2.south] {Low Willingness to Pay};
\node (n312) [N, below=of n311] {Farmer Dissatisfaction};
\draw[arr] (n2.west) to[bend right] (n311.north);
\draw[arr] (n311) -- (n312);
%
\node (n321) [E, left =of n311] {Low ability to Pay};
\node (n322) [E, below=of n321] {Low Incomes};
\node (n323) [E, below=of n322] {Low Yields};
\draw[arr] (n2.west) to[bend right] (n321.north);
\draw[arr] (n321) -- (n322);
\draw[arr] (n322) -- (n323);
%
\node (n4) [N, below=of n323.south -| n2] {Poor Irrigation Service};
\draw[arr] (n312) to[bend right] ([yshift= 1mm] n4.west);
\draw[arr] ([xshift=1mm] n323.south)
to[bend right] ([yshift=-1mm] n4.west);
%
\node (n331) [N, below right=of n2.south]
{Inability to Fund adequately O \& M};
\node (n332) [N, below=of n331] {Poor \& Ms};
\node (n333) [N, below=of n332] {Poor Irigation System};
\draw[arr] (n2.east) to[bend left] (n331.north);
\draw[arr] (n331) -- (n332);
\draw[arr] (n332) -- (n333);
\draw[arr] (n333) to[bend left] ([yshift= 1mm] n4.east);
%
\node (n34) [E, right =of n332] {Decline in Public Investment};
\draw[arr] (n2.east) to[bend left] (n34);
\draw[arr] (n34) to[bend left] ([yshift=-1mm] n4.east);
%
\node (n51) [E, below=of n323 |- n4.south,
text width=8em]
{Inadequate Agricultural Extension};
\node (n52) [E, below=of n4] {Institutional Constraints};
\draw[arr] (n51) -- (n323);
\draw[arr] (n52) -- (n4);
%
\node (n6) [E,above right=of n34.north,
text width=9em]
{Low/Declining Priority in Planned Funds for Irrigation};
\draw[arr] (n6) -- (n34);
\end{tikzpicture}
}{Source: World Bank, 1999}
\caption{Caption text}
\end{sidewaysfigure}
\end{document}