Lines plotted incorrectly on ternary diagrams when clockwise is specified

Open
#954 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia

Research direction

Start by running the Julia reproduction using ternary(clockwise=true), tern2cart, plot!, and text! shown in the issue, then compare the output with clockwise=false. Trace how ternary() handles the clockwise option and how the converted coordinates are used for plotted lines. Done means both clockwise settings place the lines and annotation in the expected locations.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Julia
Stars
222
Forks
35
Avg merge
8h 1m
Merged PRs (30d)
9

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenericMappingTools/GMT.jl

All issues in GenericMappingTools/GMT.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.