File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -76,18 +76,20 @@ function trend1d(cmd0::String="", arg1=nothing; kwargs...)
76
76
if (opt_F[1 ] == ' p' || opt_F[1 ] == ' P' || opt_F[1 ] == ' c' )
77
77
colnames = [" a$i " for i= 0 : size (D,2 )- 1 ]
78
78
else
79
+ cnames = (isa (arg1, GDtype)) ? (isa (arg1, GMTdataset) ? arg1. colnames : arg1[1 ]. colnames) : String[]
79
80
s = collect (opt_F)
80
81
colnames = Vector {String} (undef, length (s))
81
82
for k = 1 : numel (s)
82
- if (s[k] == ' x' ) colnames[k] = " x"
83
- elseif (s[k] == ' y' ) colnames[k] = " y"
83
+ if (s[k] == ' x' ) colnames[k] = isempty (cnames) ? " x" : cnames[ 1 ]
84
+ elseif (s[k] == ' y' ) colnames[k] = isempty (cnames) ? " y" : cnames[ 2 ]
84
85
elseif (s[k] == ' m' ) colnames[k] = " model"
85
86
elseif (s[k] == ' r' ) colnames[k] = " residues"
86
87
elseif (s[k] == ' w' ) colnames[k] = " weights"
87
88
end
88
89
end
89
90
end
90
91
isa (R, GMTdataset) ? (R. colnames = colnames) : (R[1 ]. colnames = colnames)
92
+ (! isempty (cnames) && cnames[1 ] == " Time" ) && settimecol! (R, 1 ) # Set time column
91
93
end
92
94
return R
93
95
end
You can’t perform that action at this time.
0 commit comments