@@ -269,6 +269,7 @@ details.
269269 xgridminor=True, xgrid=False,
270270 xlocator='month', xminorlocator='weekday', xformatter='%B') # minor ticks every Monday, major every month
271271 axs.format(ylocator='null', suptitle='Tick locators and formatters with time axes in ProPlot')
272+ plot.rc.reset()
272273
273274
274275
@@ -300,23 +301,20 @@ pass the name of any registered “axis scale” to the ``xscale`` or
300301 xcolor=c2, gridcolor=c2,
301302 suptitle='Duplicate x-axes with simple, custom transformations', ylocator=[], # locator=[] has same result as locator='null'
302303 )
303- ax.dualx(scale= 1e-3, xlabel ='kilometers', grid=True, xcolor=c1, gridcolor =c1)
304+ ax.dualx(lambda x: x* 1e-3, label ='kilometers', grid=True, color =c1)
304305 ax = axs[1]
305306 ax.format(yformatter='null', xlabel='temperature (K)', title='', xlim=(200,300), ylocator='null',
306307 xcolor=c2, gridcolor=c2)
307- ax.dualx(offset=-273.15, xlabel='temperature (\N{DEGREE SIGN}C)',
308- xcolor=c1, gridcolor=c1, grid=True)
309-
308+ ax.dualx(lambda x: x - 273.15, label='temperature (\N{DEGREE SIGN}C)', grid=True, color=c1)
310309 # These next 2 are for atmospheric scientists; note the assumed scale height is 7km
311310 f, axs = plot.subplots(ncols=2, share=0, aspect=0.4, axwidth=1.8)
312311 ax = axs[0]
313- ax.format(xformatter='null', ylabel='pressure (hPa)', ylim=(1000,10), xlocator=[],
314- gridcolor=c1, ycolor=c1)
315- ax.dualy(yscale='height', ylabel='height (km)', yticks=2.5, color=c2, gridcolor=c2, grid=True)
312+ ax.format(xformatter='null', ylabel='pressure (hPa)', ylim=(1000,10), xlocator=[], ycolor=c1)
313+ ax.dualy('height', label='height (km)', ticks=2.5, color=c2, grid=True)
316314 ax = axs[1] # span
317315 ax.format(xformatter='null', ylabel='height (km)', ylim=(0,20), xlocator='null', gridcolor=c2, ycolor=c2,
318316 suptitle='Duplicate y-axes with special transformations', grid=True)
319- ax.dualy(yscale= 'pressure', ylabel ='pressure (hPa)', ylocator =100, grid=True, color=c1, gridcolor=c1 )
317+ ax.dualy('pressure', label ='pressure (hPa)', locator =100, color=c1, grid=True )
320318
321319
322320
@@ -347,19 +345,12 @@ pass the name of any registered “axis scale” to the ``xscale`` or
347345 ax.axvline(cutoff, lw=2, ls='-', color=red)
348346 ax.fill_between([0.27, 0.33], 0, 1, color=red, alpha=0.3)
349347 ax.format(xlabel='wavenumber (days$^{-1}$)', ylabel='response', gridminor=True)
350- ax.dualx(xscale='inverse', xlocator=np.array([20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05]),
351- xlabel='period (days)',
352- title='Imaginary response function',
353- suptitle='Duplicate x-axes with wavenumber and period',
354- )
355-
356-
357-
358-
348+ ax = ax.dualx('inverse', locator=np.array([20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05]), label='period (days)')
349+ ax.format(title='Imaginary response function', suptitle='Duplicate x-axes with wavenumber and period')
359350
360351
361352
362- .. image :: cartesian/cartesian_20_1 .svg
353+ .. image :: cartesian/cartesian_20_0 .svg
363354
364355
365356Panel axes
@@ -443,7 +434,7 @@ the ``zoom_kw`` argument.
443434 axi = ax.inset([5,5,4,4], transform='data', zoom=True, zoom_kw={'color':'red', 'lw':2})
444435 axi.format(xlim=(2,4), ylim=(2,4), color='red', linewidth=1.5, ticklabelweight='bold')
445436 axi.pcolormesh(data, cmap='Grays', levels=N)
446- ax.format(suptitle='Inet axes demo')
437+ ax.format(suptitle='Inset axes demo')
447438
448439
449440
0 commit comments