diff --git a/src/gmt_main.jl b/src/gmt_main.jl index a8dc880b80..2f5b858c0d 100644 --- a/src/gmt_main.jl +++ b/src/gmt_main.jl @@ -489,7 +489,8 @@ function get_image(API::Ptr{Nothing}, object)::GMTimage if (layout != "" && layout[1] == 'I') # The special layout for using this image in Images.jl o = (nz == 1) ? (ny, nx) : (nz, ny, nx) else - o = (nz == 1) ? (ny, nx) : (ny, nx, nz) + #o = (nz == 1) ? (ny, nx) : (ny, nx, nz) + o = (nz == 1) ? (nx, ny) : (nx, ny, nz) isBRP = startswith(layout, "BRP") || startswith(layout, "TRP") (nz == 1 && isBRP) && (layout = "BRPa") # For 1 layer "BRBa" and "BRPa" is actualy the same. (!isBRP && nz > 1) && @warn("Only 'I' for Images.jl and 'BRP' MEM layouts are allowed.") diff --git a/src/psxy.jl b/src/psxy.jl index f387bdf426..e6259b5ffc 100644 --- a/src/psxy.jl +++ b/src/psxy.jl @@ -1233,7 +1233,7 @@ function make_color_column(d::Dict, cmd::String, opt_i::String, len_cmd::Int, N_ end # Filled polygons with -Z don't need extra col - ((val = find_in_dict(d, [:G :fill], false)[1]) == "+z") && return cmd, arg1, nothing, N_args, false + ((val = find_in_dict(d, [:G :fill], false)[1]) == "+z") && return cmd, arg1, arg2, N_args, false n_rows, n_col = get_sizes(arg1) # Deal with the matrix, DS & Vec{DS} cases #(isa(mz, Int) && mz <= n_col && mz == 3+is3D) && return cmd, arg1, nothing, N_args, false # zcolor column is already in place diff --git a/src/spatial_funs.jl b/src/spatial_funs.jl index 43e72865f3..345888dd70 100644 --- a/src/spatial_funs.jl +++ b/src/spatial_funs.jl @@ -1,22 +1,24 @@ # --------------------------------------------------------------------------------------------------- """ - zvals = polygonlevels(D::GDtype, ids::Vector{String}, vals::Vector{<:Real}; kw...) -> Vector{Float64} -or + zvals = polygonlevels(D::GDtype, ids::VecOrMat{String}, vals::Vector{<:Real}; kw...) -> Vector{Float64} - zvals = polygonlevels(D::GDtype, ids::Matrix{String}, vals::Vector{<:Real}; kw...) -> Vector{Float64} +Create a vector with `zvals` to use in `plot` and where length(zvals) == length(D) -Creates a vector with `zvals` to use in `plot` and where length(zvals) == length(D) The elements of `zvals` are made up from the `vals`. -- `ids`: is a string Vector or Matrix with the ids (attribute names) of the GMTdataset D. +### Args +- `D`: The data in a vector of GMTdataset. +- `ids`: is a string Vector or Matrix with the ids (attribute names) of the GMTdataset `D`. If a Matrix (2 columns only) then the `att` bellow must also have the two names (string vector with two elements) that will be matched against the two elements of each line of `ids`. The idea here is to match two conditions: `att[1] == ids[n,1] && att[2] == ids[n,2]` - `vals`: is a vector with the numbers to be used in plot `level` to color the polygons. -- `attrib` or `att`: keyword to select which attribute to use when matching with contents of the `ids` strings. -- `nocase` or `insensitive`: a keyword from `kw`. Perform a case insensitive comparision between the contents of + +### Kwargs +- `attrib` or `att`: Select which attribute to use when matching with contents of the `ids` strings. +- `nocase` or `insensitive`: Perform a case insensitive comparision between the contents of `ids` and the attribute specified with `attrib`. Default compares as case sensistive. -- `repeat`: keyword to replicate the previously known value until it finds a new segment ID for the case +- `repeat`: Replicate the previously known value until it finds a new segment ID for the case when a polygon have no attributes (may happen for the islands in a country). Returns a Vector{Float64} with the same length as the number of segments in D. Its content are