Format .jl files [skip ci] (#3872)

Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2021-10-11 17:18:02 +02:00 committed by GitHub
parent 86a9b8bf6d
commit fb82722dd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 38 deletions

View File

@ -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)
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]
dy = tickpoints[2][2] - tickpoints[1][2]
@ -1641,15 +1641,16 @@ function gr_label_ticks_3d(sp, letter, ticks)
sgn2a = sgn2b = sgn3 = 0
if axisθ != 0 || rot % 90 != 0
sgn2a = (axisθ != 90) &&
(axisθ == 0 && (rot < 90 || 180 rot < 270)) ||
sgn2a =
(axisθ != 90) && (axisθ == 0 && (rot < 90 || 180 rot < 270)) ||
(axisθ == 270) ||
(axisθ < 90 && (axisθ < rot < 90 || axisθ + 180 < rot < 270)) ||
(axisθ > 270 && (rot < 90 || axisθ - 180 < rot < 270 || rot > axisθ)) ? -1 : 1
end
if (axisθ - 90) % 180 != 0 || (rot - 90) % 180 != 0
sgn2b = axisθ == 0 ||
sgn2b =
axisθ == 0 ||
(axisθ == 90 && (90 rot < 180 || 270 rot < 360)) ||
(axisθ == 270 && (rot < 90 || 180 rot < 270)) ||
(axisθ < 90 && (axisθ < rot < 180 || axisθ + 180 < rot)) ||
@ -1657,19 +1658,23 @@ function gr_label_ticks_3d(sp, letter, ticks)
end
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θ == 270 && rot > 180) ||
(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
for (cv, dv) in zip((cvs, dvs)...)
xi, yi = gr_w3tondc(sort_3d_axes(cv, nt, ft, letter)...)
sz_rot = gr_text_size(dv, rot)
sz = gr_text_size(dv)
x_offset = 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
x_offset =
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)
end
end
@ -2133,4 +2138,3 @@ function _display(plt::Plot{GRBackend})
end
closeall(::GRBackend) = GR.emergencyclosegks()

View File

@ -969,8 +969,7 @@ function pgfx_font(fontsize::Nothing, thickness_scaling = 1, font = "\\selectfon
end
function pgfx_should_add_to_legend(series::Series)
series.plotattributes[:primary] &&
!(
series.plotattributes[:primary] && !(
series.plotattributes[:seriestype] in (
:hexbin,
:bins2d,