4

I am trying to make a ternary plot, however the default axis is opposite of what I need to accomplish. Here is an example:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\usepgfplotslibrary{ternary}
\pgfplotsset{width=9.5cm, height=9.5cm}

\begin{document}
\begin{tikzpicture}
\begin{ternaryaxis}[
ternary limits relative=false,
xlabel= x, 
ylabel= y, 
zlabel= z,
xmin=0,
xmax=100,
ymin=0,
ymax=100,
zmin=0,
zmax=100,
clip=false,
disabledatascaling,
label style={sloped}
]

\end{ternaryaxis}
\end{tikzpicture}
\end{document}

The outcome that I want would look something like this (apart from the text being reversed):

enter image description here

I don't know if this is even possible and the manual was no help.

2
  • Question looks identical to flip-x-and-y-axis-of-ternary-graph. However not marking duplicate since there is no solution for that question either. 'x dir=reverse, y dir=reverse, z dir=reverse` are not working on ternary plots. Currently, I believe there may not be a solution to this.
    – anakrich
    Commented Nov 21, 2014 at 18:13
  • I can not really understand your question. Could you please add some more details?
    – enthu
    Commented Nov 21, 2014 at 18:35

1 Answer 1

4

Put xscale=-1 in tikzpicture options.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\usepgfplotslibrary{ternary}
\pgfplotsset{width=9.5cm, height=9.5cm}

\begin{document}
\begin{tikzpicture}[xscale=-1]    %%% <------------------
\begin{ternaryaxis}[
ternary limits relative=false,
xlabel= x,
ylabel= y,
zlabel= z,
xmin=0,
xmax=100,
ymin=0,
ymax=100,
zmin=0,
zmax=100,
clip=false,
disabledatascaling,
label style={sloped}
]

\end{ternaryaxis}
\end{tikzpicture}
\end{document}

enter image description here

Without labels flipping:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\usepgfplotslibrary{ternary}
\pgfplotsset{width=9.5cm, height=9.5cm,}

\begin{document}
\begin{tikzpicture}%[xscale=-1,]
\begin{ternaryaxis}[xscale=-1,
ternary limits relative=false,
xlabel= x,
ylabel= y,
zlabel= z,
xmin=0,
xmax=100,
ymin=0,
ymax=100,
zmin=0,
zmax=100,
clip=false,
disabledatascaling,
y label style={rotate=-60,anchor=south,yshift=3ex},
y tick label style={anchor=west},
x label style = {rotate=60,anchor=south,yshift=3ex},
x tick label style={anchor=east},
]

\end{ternaryaxis}
\end{tikzpicture}
\end{document}

enter image description here

1
  • If I missed something, please let me know.
    – user11232
    Commented Nov 22, 2014 at 1:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .