我如何才能一次镜像 tikzpicture (LTR 到 RTL)

我如何才能一次镜像 tikzpicture (LTR 到 RTL)

我有一张tikz很难手动镜像的大图。手动解决方案是将x-axis坐标改为负数,然后所有west改为等east

但很难做到。所以我需要一个比使协调为负更快的解决方案。

任何帮助将不胜感激。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{xepersian}
\settextfont{Arial}
\begin{document}
\begin{tikzpicture}
                    \draw (-1,16.5) node[circle,minimum height=0.05cm,minimum width=0.05cm,draw,very thick,fill=black,label=left:$1951$] (HT) {};
                    \draw (-1,14.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$1958$] (DT) {};
                    \draw (-1,12.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$1996$] (BST) {};
                    \draw (-1,10.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2008$] (SDT) {};
                    \draw (-1,8.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2010$] (CQT) {};
                    \draw (-1,6.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2013$] (PAT) {};
                    \draw (-1,4.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2014$] (RST) {};
                    \draw (-1,2.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2014$] (AHT) {};
                    \draw[very thick] (HT.south) |- (AHT.north);

                    \draw (1,16.5) node[minimum height=1cm,minimum width=3cm,draw,very thick,] (H) { \rl{هتلینگ ($\mathrm{H}$)}};
                    \draw (5.5,16.5) node[minimum height=1cm,minimum width=2cm,circle] (DH) {\rl{ناوردای تبدیلات خطی}};
                    \draw (10,16.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadH)
                    { \rl{ناکارا در شرایط بُعد بالا}};
                    \draw (1,14.5) node[minimum height=1cm,minimum width=3cm,draw,very thick] (D) {\rl{دمپستر ($\mathbf{D}$)}};
                    \draw (5.5,14.5) node[minimum height=1cm,minimum width=2cm,circle] (DD) 
                    {\rl{کارا در مسائل بُعد بالا}};
                    \draw (10,14.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadD)
                    { \rl{پیچیدگی محاسبه‌ی درجه آزادی مدل}};
                    \draw (1,12.5) node[minimum height=1cm,minimum width=3cm,draw] (BS) {\rl{بای و ساراناداسا (\lr{BS})}};
                    \draw (5.5,12.5) node[minimum height=1cm,minimum width=2cm,circle] (BSD) 
                    {\rl{توان مشابه \lr{D} و دقت بیشتر}};
                    \draw (10,12.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadBS)
                    { \rl{وردای تبدیلات مقیاسی}};
                    \draw (1,10.5) node[minimum height=1cm,minimum width=3cm,draw] (SD) {\rl{سریواستا و دو (\lr{SD})}};
                    \draw (5.5,10.5) node[minimum height=1cm,minimum width=2cm,circle] (SDD) 
                    {\rl{ناوردای تبدیلات مقیاسی}};
                    \draw (10,10.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadSD)
                    { \rl{فرض $\frac{p}{n} \rightarrow c$}};
                    \draw (1,8.5) node[minimum height=1cm,minimum width=3cm,draw] (CQ) {\rl{چن و کین (\lr{CQ})}};
                    \draw (5.5,8.5) node[minimum height=1cm,minimum width=2cm,circle] (CQD) 
                    {\rl{بهبود آزمون \lr{BS}}};
                    \draw (10,8.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadCQ)
                    { \rl{وردای تبدیلات مقیاسی}};
                    \draw (1,6.5) node[minimum height=1cm,minimum width=3cm,draw] (PA) {\rl{پارک و آیالا (\lr{PA})}};
                    \draw (5.5,6.5) node[minimum height=1cm,minimum width=2cm,circle] (PAD) 
                    {\rl{فرض شرط $\frac{p}{n} \rightarrow \infty$}};
                    \draw (10,6.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadPA)
                    { \rl{وردای تبدیلات مقیاسی}};
                    \draw (1,4.5) node[minimum height=1cm,minimum width=3cm,draw] (RS) {\rl{ثولین (\lr{RS})}};
                    \draw (5.5,4.5) node[minimum height=1cm,minimum width=2cm,circle] (RSD) 
                    {\rl{تشخیص‌دهنده‌ی بُعدهای عامل انحراف}};
                    \draw (10,4.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadRS)
                    { \rl{وردای تبدیلات مکان و مقیاس}};
                    \draw (10,3.9) node[minimum height=1cm,minimum width=3cm,very thick,] (BadRS2)
                    { \rl{و فرض نرمال بودن داده‌ها}};
                    \draw (1,2.5) node[minimum height=1cm,minimum width=3cm,draw] (AH) {\rl{احمد (\lr{AH})}};
                    \draw (5.5,2.5) node[minimum height=1cm,minimum width=2cm,circle] (AHD)
                    {\rl{در داده‌های همبسته پرتوان‌تر از $\texttt{RS}$}};
                    \draw (10,2.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadAH)
                    { \rl{فرض نرمال‌بودن داده‌ها}};
                    \draw[-<,very thick,dashed] (H.south) |- (D.north);
                    \draw[-<,very thick,dashed] (H.east) |- (DH.west);
                    \draw[-<,very thick,dashed] (D.east) |- (DD.west);
                    \draw[-<,very thick,dashed] (DD.east) |- (BadD.west);
                    \draw[-<,very thick,dashed] (DH.east) |- (BadH.west);
                    \draw[-<,very thick] (D.south) |- (BS.north);       
                    \draw[bend left,->,very thick] (BS.east) to node [auto] {}
                    (CQ.east);
                    \draw[-<,very thick,dashed] (BS.east) |- (BSD.west);
                    \draw[-<,very thick,dashed] (BSD.east) |- (BadBS.west);
                    \draw[-<,very thick,dashed] (SD.east) |- (SDD.west);
                    \draw[-<,very thick,dashed] (SDD.east) |- (BadSD.west);
                    \draw[bend left,->,very thick] (SD.east) to node [auto] {}
                    (PA.east);
                    \draw[-<,very thick,dashed] (CQ.east) |- (CQD.west);
                    \draw[-<,very thick,dashed] (CQD.east) |- (BadCQ.west);
                    \draw[dashed,-<,very thick] (RS.south) |- (AH.north);
                    \draw[-<,very thick,dashed] (PA.east) |- (PAD.west);
                    \draw[-<,very thick,dashed] (PAD.east) |- (BadPA.west);
                    \draw[-<,very thick,dashed] (RS.east) |- (RSD.west);
                    \draw[-<,very thick,dashed] (RSD.east) |- (BadRS.west);
                    \draw[-<,very thick,dashed] (AH.east) |- (AHD.west);
                    \draw[-<,very thick,dashed] (AHD.east) |- (BadAH.west);
                    \end{tikzpicture}
    \end{document}

答案1

应该帮你解决问题。我无法检查,因为我的安装中缺少一些 Parsi 内容。如果它不起作用,我很乐意删除该帖子。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{xepersian}
\settextfont{Arial}
\begin{document}
Reflected picture:\\
\newcommand{\NewRL}[1]{\reflectbox{\rl{#1}}}
\newcommand{\NewLR}[1]{\reflectbox{\lr{#1}}}
\reflectbox{\begin{tikzpicture}
                   \draw (-1,16.5) node[circle,minimum height=0.05cm,minimum width=0.05cm,draw,very thick,fill=black,label=left:{\reflectbox{1951}}] (HT) {};
                    \draw (-1,14.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:{\reflectbox{1958}}] (DT) {};
                    \draw (-1,12.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:{\reflectbox{1996}}] (BST) {};
                    \draw (-1,10.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:{\reflectbox{2008}}] (SDT) {};
                    \draw (-1,8.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:{\reflectbox{2010}}] (CQT) {};
                    \draw (-1,6.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:{\reflectbox{2013}}] (PAT) {};
                    \draw (-1,4.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:{\reflectbox{2014}}] (RST) {};
                    \draw (-1,2.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:{\reflectbox{2014}}] (AHT) {};
                    \draw[very thick] (HT.south) |- (AHT.north);

                    \draw (1,16.5) node[minimum height=1cm,minimum width=3cm,draw,very thick,] (H) { \NewRL{هتلینگ ($\mathrm{H}$)}};
                    \draw (5.5,16.5) node[minimum height=1cm,minimum width=2cm,circle] (DH) {\NewRL{ناوردای تبدیلات خطی}};
                    \draw (10,16.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadH)
                    { \NewRL{ناکارا در شرایط بُعد بالا}};
                    \draw (1,14.5) node[minimum height=1cm,minimum width=3cm,draw,very thick] (D) {\NewRL{دمپستر ($\mathbf{D}$)}};
                    \draw (5.5,14.5) node[minimum height=1cm,minimum width=2cm,circle] (DD) 
                    {\NewRL{کارا در مسائل بُعد بالا}};
                    \draw (10,14.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadD)
                    { \NewRL{پیچیدگی محاسبه‌ی درجه آزادی مدل}};
                    \draw (1,12.5) node[minimum height=1cm,minimum width=3cm,draw] (BS) {\NewRL{بای و ساراناداسا (\NewLR{BS})}};
                    \draw (5.5,12.5) node[minimum height=1cm,minimum width=2cm,circle] (BSD) 
                    {\NewRL{توان مشابه \NewLR{D} و دقت بیشتر}};
                    \draw (10,12.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadBS)
                    { \NewRL{وردای تبدیلات مقیاسی}};
                    \draw (1,10.5) node[minimum height=1cm,minimum width=3cm,draw] (SD) {\NewRL{سریواستا و دو (\NewLR{SD})}};
                    \draw (5.5,10.5) node[minimum height=1cm,minimum width=2cm,circle] (SDD) 
                    {\NewRL{ناوردای تبدیلات مقیاسی}};
                    \draw (10,10.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadSD)
                    { \NewRL{فرض $\frac{p}{n} \rightarrow c$}};
                    \draw (1,8.5) node[minimum height=1cm,minimum width=3cm,draw] (CQ) {\NewRL{چن و کین (\NewLR{CQ})}};
                    \draw (5.5,8.5) node[minimum height=1cm,minimum width=2cm,circle] (CQD) 
                    {\NewRL{بهبود آزمون \NewLR{BS}}};
                    \draw (10,8.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadCQ)
                    { \NewRL{وردای تبدیلات مقیاسی}};
                    \draw (1,6.5) node[minimum height=1cm,minimum width=3cm,draw] (PA) {\NewRL{پارک و آیالا (\NewLR{PA})}};
                    \draw (5.5,6.5) node[minimum height=1cm,minimum width=2cm,circle] (PAD) 
                    {\NewRL{فرض شرط $\frac{p}{n} \rightarrow \infty$}};
                    \draw (10,6.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadPA)
                    { \NewRL{وردای تبدیلات مقیاسی}};
                    \draw (1,4.5) node[minimum height=1cm,minimum width=3cm,draw] (RS) {\NewRL{ثولین (\NewLR{RS})}};
                    \draw (5.5,4.5) node[minimum height=1cm,minimum width=2cm,circle] (RSD) 
                    {\NewRL{تشخیص‌دهنده‌ی بُعدهای عامل انحراف}};
                    \draw (10,4.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadRS)
                    { \NewRL{وردای تبدیلات مکان و مقیاس}};
                    \draw (10,3.9) node[minimum height=1cm,minimum width=3cm,very thick,] (BadRS2)
                    { \NewRL{و فرض نرمال بودن داده‌ها}};
                    \draw (1,2.5) node[minimum height=1cm,minimum width=3cm,draw] (AH) {\NewRL{احمد (\NewLR{AH})}};
                    \draw (5.5,2.5) node[minimum height=1cm,minimum width=2cm,circle] (AHD)
                    {\NewRL{در داده‌های همبسته پرتوان‌تر از $\texttt{RS}$}};
                    \draw (10,2.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadAH)
                    { \NewRL{فرض نرمال‌بودن داده‌ها}};
                    \draw[-<,very thick,dashed] (H.south) |- (D.north);
                    \draw[-<,very thick,dashed] (H.east) |- (DH.west);
                    \draw[-<,very thick,dashed] (D.east) |- (DD.west);
                    \draw[-<,very thick,dashed] (DD.east) |- (BadD.west);
                    \draw[-<,very thick,dashed] (DH.east) |- (BadH.west);
                    \draw[-<,very thick] (D.south) |- (BS.north);       
                    \draw[bend left,->,very thick] (BS.east) to node [auto] {}
                    (CQ.east);
                    \draw[-<,very thick,dashed] (BS.east) |- (BSD.west);
                    \draw[-<,very thick,dashed] (BSD.east) |- (BadBS.west);
                    \draw[-<,very thick,dashed] (SD.east) |- (SDD.west);
                    \draw[-<,very thick,dashed] (SDD.east) |- (BadSD.west);
                    \draw[bend left,->,very thick] (SD.east) to node [auto] {}
                    (PA.east);
                    \draw[-<,very thick,dashed] (CQ.east) |- (CQD.west);
                    \draw[-<,very thick,dashed] (CQD.east) |- (BadCQ.west);
                    \draw[dashed,-<,very thick] (RS.south) |- (AH.north);
                    \draw[-<,very thick,dashed] (PA.east) |- (PAD.west);
                    \draw[-<,very thick,dashed] (PAD.east) |- (BadPA.west);
                    \draw[-<,very thick,dashed] (RS.east) |- (RSD.west);
                    \draw[-<,very thick,dashed] (RSD.east) |- (BadRS.west);
                    \draw[-<,very thick,dashed] (AH.east) |- (AHD.west);
                    \draw[-<,very thick,dashed] (AHD.east) |- (BadAH.west);
                    \end{tikzpicture}
}

Original picture:\\


\begin{tikzpicture}
                    \draw (-1,16.5) node[circle,minimum height=0.05cm,minimum width=0.05cm,draw,very thick,fill=black,label=left:$1951$] (HT) {};
                    \draw (-1,14.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$1958$] (DT) {};
                    \draw (-1,12.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$1996$] (BST) {};
                    \draw (-1,10.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2008$] (SDT) {};
                    \draw (-1,8.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2010$] (CQT) {};
                    \draw (-1,6.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2013$] (PAT) {};
                    \draw (-1,4.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2014$] (RST) {};
                    \draw (-1,2.5) node[fill=black,circle,minimum height=0.1cm,minimum width=0.1cm,draw,very thick,label=left:$2014$] (AHT) {};
                    \draw[very thick] (HT.south) |- (AHT.north);

                    \draw (1,16.5) node[minimum height=1cm,minimum width=3cm,draw,very thick,] (H) { \rl{هتلینگ ($\mathrm{H}$)}};
                    \draw (5.5,16.5) node[minimum height=1cm,minimum width=2cm,circle] (DH) {\rl{ناوردای تبدیلات خطی}};
                    \draw (10,16.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadH)
                    { \rl{ناکارا در شرایط بُعد بالا}};
                    \draw (1,14.5) node[minimum height=1cm,minimum width=3cm,draw,very thick] (D) {\rl{دمپستر ($\mathbf{D}$)}};
                    \draw (5.5,14.5) node[minimum height=1cm,minimum width=2cm,circle] (DD) 
                    {\rl{کارا در مسائل بُعد بالا}};
                    \draw (10,14.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadD)
                    { \rl{پیچیدگی محاسبه‌ی درجه آزادی مدل}};
                    \draw (1,12.5) node[minimum height=1cm,minimum width=3cm,draw] (BS) {\rl{بای و ساراناداسا (\lr{BS})}};
                    \draw (5.5,12.5) node[minimum height=1cm,minimum width=2cm,circle] (BSD) 
                    {\rl{توان مشابه \lr{D} و دقت بیشتر}};
                    \draw (10,12.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadBS)
                    { \rl{وردای تبدیلات مقیاسی}};
                    \draw (1,10.5) node[minimum height=1cm,minimum width=3cm,draw] (SD) {\rl{سریواستا و دو (\lr{SD})}};
                    \draw (5.5,10.5) node[minimum height=1cm,minimum width=2cm,circle] (SDD) 
                    {\rl{ناوردای تبدیلات مقیاسی}};
                    \draw (10,10.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadSD)
                    { \rl{فرض $\frac{p}{n} \rightarrow c$}};
                    \draw (1,8.5) node[minimum height=1cm,minimum width=3cm,draw] (CQ) {\rl{چن و کین (\lr{CQ})}};
                    \draw (5.5,8.5) node[minimum height=1cm,minimum width=2cm,circle] (CQD) 
                    {\rl{بهبود آزمون \lr{BS}}};
                    \draw (10,8.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadCQ)
                    { \rl{وردای تبدیلات مقیاسی}};
                    \draw (1,6.5) node[minimum height=1cm,minimum width=3cm,draw] (PA) {\rl{پارک و آیالا (\lr{PA})}};
                    \draw (5.5,6.5) node[minimum height=1cm,minimum width=2cm,circle] (PAD) 
                    {\rl{فرض شرط $\frac{p}{n} \rightarrow \infty$}};
                    \draw (10,6.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadPA)
                    { \rl{وردای تبدیلات مقیاسی}};
                    \draw (1,4.5) node[minimum height=1cm,minimum width=3cm,draw] (RS) {\rl{ثولین (\lr{RS})}};
                    \draw (5.5,4.5) node[minimum height=1cm,minimum width=2cm,circle] (RSD) 
                    {\rl{تشخیص‌دهنده‌ی بُعدهای عامل انحراف}};
                    \draw (10,4.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadRS)
                    { \rl{وردای تبدیلات مکان و مقیاس}};
                    \draw (10,3.9) node[minimum height=1cm,minimum width=3cm,very thick,] (BadRS2)
                    { \rl{و فرض نرمال بودن داده‌ها}};
                    \draw (1,2.5) node[minimum height=1cm,minimum width=3cm,draw] (AH) {\rl{احمد (\lr{AH})}};
                    \draw (5.5,2.5) node[minimum height=1cm,minimum width=2cm,circle] (AHD)
                    {\rl{در داده‌های همبسته پرتوان‌تر از $\texttt{RS}$}};
                    \draw (10,2.5) node[minimum height=1cm,minimum width=3cm,very thick,] (BadAH)
                    { \rl{فرض نرمال‌بودن داده‌ها}};
                    \draw[-<,very thick,dashed] (H.south) |- (D.north);
                    \draw[-<,very thick,dashed] (H.east) |- (DH.west);
                    \draw[-<,very thick,dashed] (D.east) |- (DD.west);
                    \draw[-<,very thick,dashed] (DD.east) |- (BadD.west);
                    \draw[-<,very thick,dashed] (DH.east) |- (BadH.west);
                    \draw[-<,very thick] (D.south) |- (BS.north);       
                    \draw[bend left,->,very thick] (BS.east) to node [auto] {}
                    (CQ.east);
                    \draw[-<,very thick,dashed] (BS.east) |- (BSD.west);
                    \draw[-<,very thick,dashed] (BSD.east) |- (BadBS.west);
                    \draw[-<,very thick,dashed] (SD.east) |- (SDD.west);
                    \draw[-<,very thick,dashed] (SDD.east) |- (BadSD.west);
                    \draw[bend left,->,very thick] (SD.east) to node [auto] {}
                    (PA.east);
                    \draw[-<,very thick,dashed] (CQ.east) |- (CQD.west);
                    \draw[-<,very thick,dashed] (CQD.east) |- (BadCQ.west);
                    \draw[dashed,-<,very thick] (RS.south) |- (AH.north);
                    \draw[-<,very thick,dashed] (PA.east) |- (PAD.west);
                    \draw[-<,very thick,dashed] (PAD.east) |- (BadPA.west);
                    \draw[-<,very thick,dashed] (RS.east) |- (RSD.west);
                    \draw[-<,very thick,dashed] (RSD.east) |- (BadRS.west);
                    \draw[-<,very thick,dashed] (AH.east) |- (AHD.west);
                    \draw[-<,very thick,dashed] (AHD.east) |- (BadAH.west);
                    \end{tikzpicture}

\end{document}

答案2

要镜像tikzpicture,您可以使用选项

  1. [xscale=-1]为了水平的镜像
  2. [yscale=-1]为了垂直的镜像或
  3. [scale=-1]为了两个轴镜像

在您的情况下,您有一些带有选项的节点[left]...这样,最好的解决方案就是使用您的编辑器将“ left:$”替换为“ right:$”,因为我认为这个精确的短语只出现在特定的位置,而不会出现在其他位置,替换会产生问题......

相关内容