Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-standard axis directions #9

Open
AndrewFalkowski opened this issue Oct 14, 2022 · 1 comment
Open

Non-standard axis directions #9

AndrewFalkowski opened this issue Oct 14, 2022 · 1 comment

Comments

@AndrewFalkowski
Copy link

AndrewFalkowski commented Oct 14, 2022

Looking to replicate a non-standard ternary plot where the left and bottom axis increase from the bottom left corner (example). This structure is fairly standard in my field, but I haven't found a single ternary plotting library capable of replicating it. Wondering if there is some way to define custom axis directions in your library?

Thanks!

@yuzie007
Copy link
Owner

Thank you @AndrewFalkowski for taking a look on mpltern. Please find the following snippet, which may mostly reproduce the tick style in your example.

import matplotlib.pyplot as plt
import mpltern


ax = plt.subplot(projection="ternary")

ax.plot([0.1, 0.2], [0.2, 0.4], [0.7, 0.4])

ax.set_tlabel("Sn")
ax.set_llabel("Bi")
ax.set_rlabel("Cu")

ax.taxis.set_tick_params(
    which="both",
    tick1On=True,
    label1On=False,
    tick2On=True,
    label2On=True,
)
ax.laxis.set_tick_params(
    which="both",
    tick1On=True,
    label1On=False,
    tick2On=True,
    label2On=False,
)
ax.raxis.set_tick_params(
    which="both",
    tick1On=True,
    label1On=True,
    tick2On=True,
    label2On=False,
)

plt.show()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants