# Ternary plots in GMT.jl

**URL:** <https://discourse.julialang.org/t/ternary-plots-in-gmt-jl/63181>\
**Category:** Visualization\
**Tags:** plotting, gmt\
**Created:** [June 19, 2021, 12:45pm UTC](https://discourse.julialang.org/t/ternary-plots-in-gmt-jl/63181 "2021-06-19T12:45:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [July 4, 2021, 6:00pm UTC](https://discourse.julialang.org/t/ternary-plots-in-gmt-jl/63181/4 "2021-07-04T18:00:17Z")

</div>

Interested also on how to do this with GMT.

Fyi, it is already possible to do something like it using [TernaryPlots.jl](https://github.com/jacobusmmsmit/TernaryPlots.jl), a package that seems to be at early stages:

 ![TernaryPlots_smooth_curves](https://global.discourse-cdn.com/julialang/original/3X/4/7/47c288d0900fbf08d5e8896f7624211784d1a877.png)

The corresponding code is provided below:

```julia
using TernaryPlots

b = 0:0.01:0.3
c1 = (1 .- b).^3 .- 0.7^3
c2 = (1 .- 2*b).^2 .- 0.4^2
t1 = tern2cart.(1 .- b .- c1, b, c1)
t2 = tern2cart.(1 .- b .- c2, b, c2)

p = TernaryPlots.ternary_plot(title="TernaryPlots.jl",labels=(A="A", B="B", C="C"))
plot!(p, [t1...], lw=2, lc=:red)
plot!(p, [t2...], lw=2, lc=:blue)

```

---

_[View the full topic](https://discourse.julialang.org/t/ternary-plots-in-gmt-jl/63181)._
