move zaxis to the left
This commit is contained in:
parent
85e5f2e971
commit
c5fe90d135
28
src/axes.jl
28
src/axes.jl
@ -931,12 +931,12 @@ function axis_drawing_info_3d(sp::Subplot)
|
|||||||
x1, x2 = if sp[:framestyle] in (:origin, :zerolines)
|
x1, x2 = if sp[:framestyle] in (:origin, :zerolines)
|
||||||
0.0, 0.0
|
0.0, 0.0
|
||||||
else
|
else
|
||||||
xor(zaxis[:mirror], xaxis[:flip]) ? (xmin, xmax) : (xmax, xmin)
|
xor(zaxis[:mirror], xaxis[:flip]) ? (xmax, xmin) : (xmin, xmax)
|
||||||
end
|
end
|
||||||
y1, y2 = if sp[:framestyle] in (:origin, :zerolines)
|
y1, y2 = if sp[:framestyle] in (:origin, :zerolines)
|
||||||
0.0, 0.0
|
0.0, 0.0
|
||||||
else
|
else
|
||||||
xor(zaxis[:mirror], yaxis[:flip]) ? (ymin, ymax) : (ymax, ymin)
|
xor(zaxis[:mirror], yaxis[:flip]) ? (ymax, ymin) : (ymin, ymax)
|
||||||
end
|
end
|
||||||
if zaxis[:showaxis]
|
if zaxis[:showaxis]
|
||||||
if sp[:framestyle] != :grid
|
if sp[:framestyle] != :grid
|
||||||
@ -953,48 +953,48 @@ function axis_drawing_info_3d(sp::Subplot)
|
|||||||
f = scalefunc(xaxis[:scale])
|
f = scalefunc(xaxis[:scale])
|
||||||
invf = invscalefunc(xaxis[:scale])
|
invf = invscalefunc(xaxis[:scale])
|
||||||
tick_start, tick_stop = if sp[:framestyle] == :origin
|
tick_start, tick_stop = if sp[:framestyle] == :origin
|
||||||
t = invf(f(0) + 0.012 * (f(xmax) - f(xmin)))
|
t = invf(f(0) + 0.012 * (f(ymax) - f(ymin)))
|
||||||
(-t, t)
|
(-t, t)
|
||||||
else
|
else
|
||||||
ticks_in = zaxis[:tick_direction] == :out ? -1 : 1
|
ticks_in = zaxis[:tick_direction] == :out ? -1 : 1
|
||||||
t = invf(f(x1) + 0.012 * (f(x2) - f(x1)) * ticks_in)
|
t = invf(f(y1) + 0.012 * (f(y2) - f(y1)) * ticks_in)
|
||||||
(x1, t)
|
(y1, t)
|
||||||
end
|
end
|
||||||
|
|
||||||
for ztick in zticks[1]
|
for ztick in zticks[1]
|
||||||
if zaxis[:showaxis]
|
if zaxis[:showaxis]
|
||||||
push!(ztick_segs, (tick_start, y1, ztick), (tick_stop, y1, ztick)) # left tick
|
push!(ztick_segs, (x1, tick_start, ztick), (x1, tick_stop, ztick)) # left tick
|
||||||
end
|
end
|
||||||
if zaxis[:grid]
|
if zaxis[:grid]
|
||||||
if sp[:framestyle] in (:origin, :zerolines)
|
if sp[:framestyle] in (:origin, :zerolines)
|
||||||
push!(zgrid_segs, (xmin, 0.0, ztick), (xmax, 0.0, ztick))
|
push!(zgrid_segs, (xmin, 0.0, ztick), (xmax, 0.0, ztick))
|
||||||
push!(ygrid_segs, (0.0, ymin, ztick), (0.0, ymax, ztick))
|
push!(ygrid_segs, (0.0, ymin, ztick), (0.0, ymax, ztick))
|
||||||
else
|
else
|
||||||
push!(ygrid_segs, (x1, y1, ztick), (x2, y1, ztick))
|
push!(ygrid_segs, (x1, y1, ztick), (x1, y2, ztick))
|
||||||
push!(ygrid_segs, (x2, y1, ztick), (x2, y2, ztick))
|
push!(ygrid_segs, (x1, y2, ztick), (x2, y2, ztick))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if !(zaxis[:minorticks] in (:none, nothing, false)) || zaxis[:minorgrid]
|
if !(zaxis[:minorticks] in (:none, nothing, false)) || zaxis[:minorgrid]
|
||||||
tick_start, tick_stop = if sp[:framestyle] == :origin
|
tick_start, tick_stop = if sp[:framestyle] == :origin
|
||||||
t = invf(f(0) + 0.006 * (f(xmax) - f(xmin)))
|
t = invf(f(0) + 0.006 * (f(ymax) - f(ymin)))
|
||||||
(-t, t)
|
(-t, t)
|
||||||
else
|
else
|
||||||
t = invf(f(x1) + 0.006 * (f(x2) - f(x1)) * ticks_in)
|
t = invf(f(y1) + 0.006 * (f(y2) - f(y1)) * ticks_in)
|
||||||
(x1, t)
|
(y1, t)
|
||||||
end
|
end
|
||||||
for ztick in zminorticks
|
for ztick in zminorticks
|
||||||
if zaxis[:showaxis]
|
if zaxis[:showaxis]
|
||||||
push!(ztick_segs, (tick_start, y1, ztick), (tick_stop, y1, ztick)) # left tick
|
push!(ztick_segs, (x1, tick_start, ztick), (x1, tick_stop, ztick)) # left tick
|
||||||
end
|
end
|
||||||
if zaxis[:minorgrid]
|
if zaxis[:minorgrid]
|
||||||
if sp[:framestyle] in (:origin, :zerolines)
|
if sp[:framestyle] in (:origin, :zerolines)
|
||||||
push!(zminorgrid_segs, (xmin, 0.0, ztick), (xmax, 0.0, ztick))
|
push!(zminorgrid_segs, (xmin, 0.0, ztick), (xmax, 0.0, ztick))
|
||||||
push!(zminorgrid_segs, (0.0, ymin, ztick), (0.0, ymax, ztick))
|
push!(zminorgrid_segs, (0.0, ymin, ztick), (0.0, ymax, ztick))
|
||||||
else
|
else
|
||||||
push!(zminorgrid_segs, (x1, y1, ztick), (x2, y1, ztick))
|
push!(zminorgrid_segs, (x1, y1, ztick), (x1, y2, ztick))
|
||||||
push!(zminorgrid_segs, (x2, y1, ztick), (x2, y2, ztick))
|
push!(zminorgrid_segs, (x1, y2, ztick), (x2, y2, ztick))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1188,23 +1188,23 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
# z labels
|
# z labels
|
||||||
gr_set_font(
|
gr_set_font(
|
||||||
tickfont(zaxis),
|
tickfont(zaxis),
|
||||||
halign = (zaxis[:mirror] ? :right : :left),
|
halign = (zaxis[:mirror] ? :left : :right),
|
||||||
valign = (:top, :vcenter, :bottom)[sign(zaxis[:rotation]) + 2],
|
valign = (:top, :vcenter, :bottom)[sign(zaxis[:rotation]) + 2],
|
||||||
rotation = zaxis[:rotation]
|
rotation = zaxis[:rotation]
|
||||||
)
|
)
|
||||||
xt = if sp[:framestyle] == :origin
|
xt = if sp[:framestyle] == :origin
|
||||||
0
|
0
|
||||||
elseif xor(zaxis[:mirror], xaxis[:flip])
|
elseif xor(zaxis[:mirror], xaxis[:flip])
|
||||||
xmin
|
|
||||||
else
|
|
||||||
xmax
|
xmax
|
||||||
|
else
|
||||||
|
xmin
|
||||||
end
|
end
|
||||||
yt = if sp[:framestyle] == :origin
|
yt = if sp[:framestyle] == :origin
|
||||||
0
|
0
|
||||||
elseif xor(zaxis[:mirror], yaxis[:flip])
|
elseif xor(zaxis[:mirror], yaxis[:flip])
|
||||||
ymin
|
|
||||||
else
|
|
||||||
ymax
|
ymax
|
||||||
|
else
|
||||||
|
ymin
|
||||||
end
|
end
|
||||||
for (cv, dv) in zip(zticks...)
|
for (cv, dv) in zip(zticks...)
|
||||||
xi, yi, zi = GR.wc3towc(xt, yt, cv)
|
xi, yi, zi = GR.wc3towc(xt, yt, cv)
|
||||||
@ -1218,7 +1218,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
dv = convert_sci_unicode(dv)
|
dv = convert_sci_unicode(dv)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
gr_text(xi + (zaxis[:mirror] ? -1 : 1) * 1e-2 * (zaxis[:tick_direction] == :out ? 1.5 : 1.0), yi, string(dv))
|
gr_text(xi + (zaxis[:mirror] ? 1 : -1) * 1e-2 * (zaxis[:tick_direction] == :out ? 1.5 : 1.0), yi, string(dv))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user