def style_1d_sensel_func(pylab, n, y_max, extra_vspace=1.1): """ Decorates approapriateyle """ y_axis_set(pylab, -y_max * extra_vspace, y_max * extra_vspace) x_axis_set(pylab, -1, n) turn_off_bottom_and_top(pylab) turn_off_right(pylab) set_left_spines_outward(pylab, offset=10) set_thick_ticks(pylab, markersize=3, markeredgewidth=1) pylab.plot([0, n - 1], [0, 0], "--", color=[0.7, 0.7, 0.7])
def set_spines_look_B_Demo(r): f = r.figure() x = np.linspace(0, 2 * np.pi, 100) y = 2 * np.sin(x) for marker in [0, 1, 2, 3, 4, 5]: with f.plot( figsize=(3, 2), caption='set_spines_look_A(pylab, outward_offset=%s)' % marker ) as pylab: pylab.plot(x, y) set_thick_ticks(pylab) ax = pylab.gca() ticks = ax.xaxis.get_majorticklines() for t in ticks: t.set_marker(marker)
def set_spines_look_B_Demo(r): f = r.figure() x = np.linspace(0, 2 * np.pi, 100) y = 2 * np.sin(x) for marker in [0, 1, 2, 3, 4, 5]: with f.plot( figsize=(3, 2), caption="set_spines_look_A(pylab, outward_offset=%s)" % marker, ) as pylab: pylab.plot(x, y) set_thick_ticks(pylab) ax = pylab.gca() ticks = ax.xaxis.get_majorticklines() for t in ticks: t.set_marker(marker)