()
| 7052 | |
| 7053 | |
| 7054 | def test_tick_label_update(): |
| 7055 | # test issue 9397 |
| 7056 | |
| 7057 | fig, ax = plt.subplots() |
| 7058 | |
| 7059 | # Set up a dummy formatter |
| 7060 | def formatter_func(x, pos): |
| 7061 | return "unit value" if x == 1 else "" |
| 7062 | ax.xaxis.set_major_formatter(plt.FuncFormatter(formatter_func)) |
| 7063 | |
| 7064 | # Force some of the x-axis ticks to be outside of the drawn range |
| 7065 | ax.set_xticks([-1, 0, 1, 2, 3]) |
| 7066 | ax.set_xlim(-0.5, 2.5) |
| 7067 | |
| 7068 | fig.canvas.draw() |
| 7069 | tick_texts = [tick.get_text() for tick in ax.xaxis.get_ticklabels()] |
| 7070 | assert tick_texts == ["", "", "unit value", "", ""] |
| 7071 | |
| 7072 | |
| 7073 | @image_comparison(['o_marker_path_snap.png'], savefig_kwarg={'dpi': 72}, style='mpl20') |
nothing calls this directly
no test coverage detected
searching dependent graphs…