You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have more than 10 majorTicks on the X-axis. label1On is False for each of the odd numbered majorTicks. Call tick_params as shown in subject and label1On is True for all MajorTick members after return.
Code for reproduction
major_ticks=axis.xaxis.get_major_ticks()
iflen(major_ticks) >10:
fori, tickinenumerate(major_ticks):
if (i%2) ==1:
tick.label1On=Falselogger.info("the value of label1O is %r", axis.xaxis.majorTicks[1].label1On)
axis.tick_params(axis='both', which='major', length=5)
logger.info("the value of label1O is %r", axis.xaxis.majorTicks[1].label1On)
Actual outcome
2019-01-18 16:42:28,509 - unavco.plotter.posfile - INFO - the value of label1O is False
2019-01-18 16:42:36,626 - unavco.plotter.posfile - INFO - the value of label1O is True
Expected outcome
I expected the value of label1On to not change.
Use to work with version 1.2.0 and python 2.7
label1On is deprecated since #10088; however, the equivalent code using set_visible and get_visible works without suffering from the same issue, as of master.
from pylab import *
ax = gca()
major_ticks = ax.xaxis.get_major_ticks()
for i, tick in enumerate(major_ticks):
if i % 2 == 1:
tick.set_visible(False)
print(ax.xaxis.majorTicks[1].get_visible())
ax.tick_params(axis='both', which='major', length=5)
print(ax.xaxis.majorTicks[1].get_visible())
plt.show()
I am going to close this as fixed in master (per the above -- the mechanism is different now), and milestone as 3.0.x in case someone really wants to put in a separate fix for that branch.
Bug report
Bug summary
I have more than 10 majorTicks on the X-axis. label1On is False for each of the odd numbered majorTicks. Call tick_params as shown in subject and label1On is True for all MajorTick members after return.
Code for reproduction
Actual outcome
Expected outcome
I expected the value of label1On to not change.
Use to work with version 1.2.0 and python 2.7
Matplotlib version
print(matplotlib.get_backend())
): MacOSXyum install after install python 3.6
The text was updated successfully, but these errors were encountered: