fix scale aliases

This commit is contained in:
Thomas Breloff 2016-06-12 11:00:42 -04:00
parent 2f60da33b7
commit f1e566dddc
4 changed files with 17 additions and 5 deletions

View File

@ -751,11 +751,15 @@ function warnOnUnsupported(pkg::AbstractBackend, d::KW)
end
function warnOnUnsupportedScales(pkg::AbstractBackend, d::KW)
for k in (:xscale, :yscale)
if haskey(d, k)
d[k] in supportedScales(pkg) || warn("scale $(d[k]) is unsupported with $pkg. Choose from: $(supportedScales(pkg))")
for k in (:xscale, :yscale, :zscale)
if haskey(d, k)
v = d[k]
v = get(_scaleAliases, v, v)
if !(v in supportedScales(pkg))
warn("scale $(d[k]) is unsupported with $pkg. Choose from: $(supportedScales(pkg))")
end
end
end
end
end

View File

@ -91,6 +91,12 @@ function update!(axis::Axis, args...; kw...)
end
end
end
# replace scale aliases
if haskey(_scaleAliases, d[:scale])
d[:scale] = _scaleAliases[d[:scale]]
end
axis
end

View File

@ -553,10 +553,10 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
# get data limits and set the scale flags and window
data_lims = gr_xy_axislims(sp)
xmin, xmax, ymin, ymax = data_lims
scale = 0
if xmax > xmin && ymax > ymin
# NOTE: for log axes, the major_x and major_y - if non-zero (omit labels) - control the minor grid lines (1 = draw 9 minor grid lines, 2 = no minor grid lines)
# NOTE: for log axes, the x_tick and y_tick - if non-zero (omit axes) - only affect the output appearance (1 = nomal, 2 = scientiic notation)
scale = 0
xaxis[:scale] == :log10 && (scale |= GR.OPTION_X_LOG)
yaxis[:scale] == :log10 && (scale |= GR.OPTION_Y_LOG)
xaxis[:flip] && (scale |= GR.OPTION_FLIP_X)
@ -696,6 +696,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
xmin, xmax, ymin, ymax = data_lims
if xmax > xmin && ymax > ymin
GR.setwindow(xmin, xmax, ymin, ymax)
GR.setscale(scale)
end
end

View File

@ -933,6 +933,7 @@ function applyPyPlotScale(ax, scaleType::Symbol, letter)
elseif scaleType == :log10
10
end
# kw[Symbol(:linthresh,letter)] = 1e-16
"symlog"
end
func(arg; kw...)