Ternary plot in Julia Wrapper

Hi Everyone!
It’s been a while.

I wonder if @Joaquim or anyone else with experience with the Julia Wrapper would help me here.

I have 3 ternary grids. I need to plot in a single figure one contour of each grid, but ternary! seems to be replacing the figure and not appending.

I have uploaded some test data and here is the script I am running to make the figure.

Any help is welcome!

## A Terminary Diagram with Contours

using DelimitedFiles ,GMT
 
data=readdlm("TestData.txt",Float64);
 
Vp=4.6;
Vs=2.8;
Rho=2.35;
 
ternary([data[:,1] data[:,2] data[:,3] data[:,4]], frame=(annot=20, ticks=10, grid=:a, alabel="Quartz", blabel="Carbonates", clabel="Clays", suffix=" %"),contour=(annot=[Vp],contour=[Vp],labels=(distance=3,),pen=(1.0,:blue)))
ternary!([data[:,1] data[:,2] data[:,3] data[:,5]],contour=(annot=[Vs],contour=[Vs],labels=(distance=3,),pen=(1.0,:red)))
ternary!([data[:,1] data[:,2] data[:,3] data[:,6]], fmt=:pdf,contour=(annot=[Rho],contour=[Rho],labels=(distance=3,),pen=(1.0,:green)),show=true)

I have manually made the figure I am trying to get:

TestData.txt (3.1 KB)

Tricky case. The ternary Julia module extends quite a bit the pure GMT one and some of the under-the-hood calls were failing to respect the append case. I’ve fixed it in GMT.jl master and can now reproduce your example, but be prepared to see error messages like these that come from some issue in GMT itself that apparently doesn’t like that the ternary module misses the option -B

psbasemap [ERROR]: Bad interval in -B option (x-component, a-info): (null) gave interval = 0
psbasemap [ERROR]: Bad interval in -B option (y-component, a-info): (null) gave interval = 0
psbasemap [ERROR]: Option -B parsing failure. Correct syntax:

  -B Specify both (1) basemap frame settings and (2) axes parameters.
     Frame settings are modified via an optional single invocation of -B[<axes>][+b][+g<fill>][+i[<val>]][+n][+o<lon>/<lat>]⏎
       …[+s<subtitle>][+t<title>][+w[<pen>]][+x<fill>][+y<fill>][+z<fill>]
     Axes parameters are specified via one or more invocations of -B[p|s][x|y|z]<intervals>[+a<angle>|n|p][+e[l|u]][+f][+l|⏎
       …L<label>][+p<prefix>][+s|S<secondary_label>][+u<unit>
     <intervals> is composed of concatenated [<type>]<stride>[l|p] sub-strings. See basemap documentation for more details and
     examples of all settings.
psbasemap [ERROR]: Offending option -B(null)
psternary [ERROR]: Unable to plot A axis

Hi Joaquim.
Could you send me the lines?

I updated GMT.jl but I still get the same 1 contour picture.
I even deleted the GMT precomplied folder, but it is not working.

Hi Joaquim.
Could you send me the lines?

I updated GMT.jl but I still get the same 1 contour picture.
I even deleted the GMT precomplied folder, but it is not working.

Sorry returning from a day at sea.
You have to install the master version to use the modifications I made yesterday.

] add GMT#master

1 Like

That was awesome @Joaquim. Thank you so much for the help. Sorry for the double post. Didn’t mean the pressure. :slight_smile: