GMT.jl icon indicating copy to clipboard operation
GMT.jl copied to clipboard

Lines plotted incorrectly on ternary diagrams when clockwise is specified

Open lucpaoli opened this issue 3 years ago • 1 comments

When clocwise is specified within the call to ternary() the lines are plotted in the incorrect location

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

# Generate the coordinates of two lines.
t1 = GMT.tern2cart([(1 .- b .- c1) b c1])    # Note that GMT.jl function expects a Mx3 matrix
t2 = GMT.tern2cart([(1 .- b .- c2) b c2])

GMT.ternary(labels=("A", "B", "C"), clockwise=true)

GMT.plot!(t1, lw=2, lc=:red, ls="line& (a) &")	# line style -> fancy stuff
GMT.plot!(t2, lw=2, lc=:blue)
GMT.text!(GMT.tern2cart([0.3 0.4 0.3]), text="Umbilicus", font=18, show=true)

image

This occurs whether clockwise is specified as true or false. I suspect this is because clockwise=false appears to have an identical affect to clockwise=true.

lucpaoli avatar Jul 20 '22 14:07 lucpaoli

Hmm, very tricky. The problem is that plot and text know nothing about ternary clockwise, and can never know. That will have to be a job of tern2cart

joa-quim avatar Jul 20 '22 22:07 joa-quim