![鏡像X軸-pgfplot](https://rvso.com/image/335475/%E9%8F%A1%E5%83%8FX%E8%BB%B8-pgfplot.png)
答案1
例如,您可以用於x post scale=-1
第二個軸。若要消除它們之間的任何間隙,請將第二個軸的位置設為south east
第一個軸的錨點,並將其錨點設為south west
。x axis line style={-}
添加後 axis lines
/axis x line
將刪除箭頭。
要將 x 標籤放置在中間,最簡單的方法是在環境\node
後面加上一個 x 標籤axis
,放置在south east
第一個軸的角落下方。
\documentclass[border=4mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{every outer x axis line/.style={-}}
\begin{axis}[
name=ax1,
axis lines=left,
x axis line style={-}]
\addplot{x};
\end{axis}
\begin{axis}[
axis x line=bottom,
axis y line=right,
x axis line style={-},
x post scale=-1,
at={(ax1.south east)},
anchor=south west]
\addplot{x};
\end{axis}
\node [below=1cm] at (ax1.south east) {Common xlabel};
\end{tikzpicture}
\end{document}