Minorgrid and minorticks setup for pyplot

This commit is contained in:
Zh 2020-04-24 01:02:17 +09:00
parent e065ca35b0
commit 95e2ab5537

View File

@ -1135,21 +1135,34 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
pyaxis."grid"(false)
end
#
if axis[:minorticks] > 1
pyaxis."set_minor_locator"(PyPlot.matplotlib.ticker.AutoMinorLocator(axis[:minorticks]))
pyaxis."set_tick_params"(
which = "minor",
direction = axis[:tick_direction] == :out ? "out" : "in",
width=py_thickness_scale(plt, intensity))
end
if axis[:minorgrid]
ax."minorticks_on"() # PyPlot requires this to be on
if !(axis[:minorticks] > 1) # Check if ticks were already configured
ax."minorticks_on"()
end
pyaxis."set_tick_params"(
which = "minor",
direction = axis[:tick_direction] == :out ? "out" : "in",
width=py_thickness_scale(plt, intensity))
ax."grid"(true,
pyaxis."grid"(true,
which = "minor",
color = fgcolor,
linestyle = py_linestyle(:line, axis[:minorgridstyle]),
linewidth = py_thickness_scale(plt, axis[:minorgridlinewidth]),
alpha = axis[:minorgridalpha])
end
py_set_axis_colors(sp, ax, axis)
end