Format .jl files [skip ci] (#3872)
Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
This commit is contained in:
parent
86a9b8bf6d
commit
fb82722dd3
@ -712,7 +712,7 @@ text_box_height(w, h, rot) = abs(sind(rot)) * w + abs(sind(rot + 90)) * h
|
|||||||
|
|
||||||
function gr_get_3d_axis_angle(cvs, nt, ft, letter)
|
function gr_get_3d_axis_angle(cvs, nt, ft, letter)
|
||||||
length(cvs) < 2 && return 0
|
length(cvs) < 2 && return 0
|
||||||
tickpoints = [gr_w3tondc(sort_3d_axes(cv, nt, ft, letter)...) for cv ∈ cvs]
|
tickpoints = [gr_w3tondc(sort_3d_axes(cv, nt, ft, letter)...) for cv in cvs]
|
||||||
|
|
||||||
dx = tickpoints[2][1] - tickpoints[1][1]
|
dx = tickpoints[2][1] - tickpoints[1][1]
|
||||||
dy = tickpoints[2][2] - tickpoints[1][2]
|
dy = tickpoints[2][2] - tickpoints[1][2]
|
||||||
@ -1641,15 +1641,16 @@ function gr_label_ticks_3d(sp, letter, ticks)
|
|||||||
|
|
||||||
sgn2a = sgn2b = sgn3 = 0
|
sgn2a = sgn2b = sgn3 = 0
|
||||||
if axisθ != 0 || rot % 90 != 0
|
if axisθ != 0 || rot % 90 != 0
|
||||||
sgn2a = (axisθ != 90) &&
|
sgn2a =
|
||||||
(axisθ == 0 && (rot < 90 || 180 ≤ rot < 270)) ||
|
(axisθ != 90) && (axisθ == 0 && (rot < 90 || 180 ≤ rot < 270)) ||
|
||||||
(axisθ == 270) ||
|
(axisθ == 270) ||
|
||||||
(axisθ < 90 && (axisθ < rot < 90 || axisθ + 180 < rot < 270)) ||
|
(axisθ < 90 && (axisθ < rot < 90 || axisθ + 180 < rot < 270)) ||
|
||||||
(axisθ > 270 && (rot < 90 || axisθ - 180 < rot < 270 || rot > axisθ)) ? -1 : 1
|
(axisθ > 270 && (rot < 90 || axisθ - 180 < rot < 270 || rot > axisθ)) ? -1 : 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if (axisθ - 90) % 180 != 0 || (rot - 90) % 180 != 0
|
if (axisθ - 90) % 180 != 0 || (rot - 90) % 180 != 0
|
||||||
sgn2b = axisθ == 0 ||
|
sgn2b =
|
||||||
|
axisθ == 0 ||
|
||||||
(axisθ == 90 && (90 ≤ rot < 180 || 270 ≤ rot < 360)) ||
|
(axisθ == 90 && (90 ≤ rot < 180 || 270 ≤ rot < 360)) ||
|
||||||
(axisθ == 270 && (rot < 90 || 180 ≤ rot < 270)) ||
|
(axisθ == 270 && (rot < 90 || 180 ≤ rot < 270)) ||
|
||||||
(axisθ < 90 && (axisθ < rot < 180 || axisθ + 180 < rot)) ||
|
(axisθ < 90 && (axisθ < rot < 180 || axisθ + 180 < rot)) ||
|
||||||
@ -1657,19 +1658,23 @@ function gr_label_ticks_3d(sp, letter, ticks)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if !(axisθ == 0 && rot % 180 == 0) && ((rot - 90) % 180 != 0)
|
if !(axisθ == 0 && rot % 180 == 0) && ((rot - 90) % 180 != 0)
|
||||||
sgn3 = (axisθ == 0 && 90 < rot < 270) ||
|
sgn3 =
|
||||||
|
(axisθ == 0 && 90 < rot < 270) ||
|
||||||
(axisθ == 90 && rot < 180) ||
|
(axisθ == 90 && rot < 180) ||
|
||||||
(axisθ == 270 && rot > 180) ||
|
(axisθ == 270 && rot > 180) ||
|
||||||
(axisθ < 90 && (rot < axisθ || 90 ≤ rot < 180 || axisθ + 180 < rot < 270)) ||
|
(axisθ < 90 && (rot < axisθ || 90 ≤ rot < 180 || axisθ + 180 < rot < 270)) ||
|
||||||
(axisθ > 270 && (90 ≤ rot < axisθ - 180 || 180 ≤ rot < 270 || rot > axisθ)) ? -1 : 1
|
(axisθ > 270 && (90 ≤ rot < axisθ - 180 || 180 ≤ rot < 270 || rot > axisθ)) ?
|
||||||
|
-1 : 1
|
||||||
end
|
end
|
||||||
|
|
||||||
for (cv, dv) in zip((cvs, dvs)...)
|
for (cv, dv) in zip((cvs, dvs)...)
|
||||||
xi, yi = gr_w3tondc(sort_3d_axes(cv, nt, ft, letter)...)
|
xi, yi = gr_w3tondc(sort_3d_axes(cv, nt, ft, letter)...)
|
||||||
sz_rot = gr_text_size(dv, rot)
|
sz_rot = gr_text_size(dv, rot)
|
||||||
sz = gr_text_size(dv)
|
sz = gr_text_size(dv)
|
||||||
x_offset = x_base_offset + sgn2a * first(sz_rot) / 2 + sgn3 * last(sz) * sind(rot) / 2
|
x_offset =
|
||||||
y_offset = y_base_offset + sgn2b * last(sz_rot) / 2 + sgn3 * last(sz) * cosd(rot) / 2
|
x_base_offset + sgn2a * first(sz_rot) / 2 + sgn3 * last(sz) * sind(rot) / 2
|
||||||
|
y_offset =
|
||||||
|
y_base_offset + sgn2b * last(sz_rot) / 2 + sgn3 * last(sz) * cosd(rot) / 2
|
||||||
gr_text(xi + sgn * x_offset, yi + sgn * y_offset, dv)
|
gr_text(xi + sgn * x_offset, yi + sgn * y_offset, dv)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -2133,4 +2138,3 @@ function _display(plt::Plot{GRBackend})
|
|||||||
end
|
end
|
||||||
|
|
||||||
closeall(::GRBackend) = GR.emergencyclosegks()
|
closeall(::GRBackend) = GR.emergencyclosegks()
|
||||||
|
|
||||||
|
|||||||
@ -969,8 +969,7 @@ function pgfx_font(fontsize::Nothing, thickness_scaling = 1, font = "\\selectfon
|
|||||||
end
|
end
|
||||||
|
|
||||||
function pgfx_should_add_to_legend(series::Series)
|
function pgfx_should_add_to_legend(series::Series)
|
||||||
series.plotattributes[:primary] &&
|
series.plotattributes[:primary] && !(
|
||||||
!(
|
|
||||||
series.plotattributes[:seriestype] in (
|
series.plotattributes[:seriestype] in (
|
||||||
:hexbin,
|
:hexbin,
|
||||||
:bins2d,
|
:bins2d,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user