|
64 | 64 | color='dark blue', suptitlecolor='dark blue', |
65 | 65 | titleloc='upper center', titlecolor='dark blue', titleborder=False, |
66 | 66 | ) |
67 | | -fig, axs = plot.subplots(nrows=8, axwidth=5, aspect=(8, 1), share=0) |
| 67 | +fig, axs = plot.subplots(nrows=8, refwidth=5, refaspect=(8, 1), share=0) |
68 | 68 | axs.format(suptitle='Tick locators demo') |
69 | 69 |
|
70 | 70 | # Step size for tick locations |
|
163 | 163 | color='gray8', gridcolor='gray8', titlecolor='gray8', suptitlecolor='gray8', |
164 | 164 | titleloc='upper center', titleborder=False, |
165 | 165 | ) |
166 | | -fig, axs = plot.subplots(nrows=9, axwidth=5, aspect=(8, 1), share=0) |
| 166 | +fig, axs = plot.subplots(nrows=9, refwidth=5, refaspect=(8, 1), share=0) |
167 | 167 |
|
168 | 168 | # Scientific notation |
169 | 169 | axs[0].format(xlim=(0, 1e20), xformatter='sci', title='SciFormatter') |
|
212 | 212 | plot.rc.linewidth = 2 |
213 | 213 | plot.rc.fontsize = 11 |
214 | 214 | locator = [0, 0.25, 0.5, 0.75, 1] |
215 | | -fig, axs = plot.subplots(ncols=2, nrows=2, axwidth=1.5, share=0) |
| 215 | +fig, axs = plot.subplots(ncols=2, nrows=2, refwidth=1.5, share=0) |
216 | 216 |
|
217 | 217 | # Formatter comparison |
218 | 218 | axs[0].format( |
|
264 | 264 | figurefacecolor='w', facecolor='pastel blue', |
265 | 265 | titleloc='upper center', titleborder=False, |
266 | 266 | ) |
267 | | -fig, axs = plot.subplots(nrows=5, axwidth=6, aspect=(8, 1), share=0) |
| 267 | +fig, axs = plot.subplots(nrows=5, refwidth=6, refaspect=(8, 1), share=0) |
268 | 268 | axs[:4].format(xrotation=0) # no rotation for these examples |
269 | 269 |
|
270 | 270 | # Default date locator |
|
347 | 347 | plot.rc.update({ |
348 | 348 | 'linewidth': 1, 'ticklabelweight': 'bold', 'axeslabelweight': 'bold' |
349 | 349 | }) |
350 | | -fig, axs = plot.subplots(ncols=2, nrows=2, axwidth=1.8, share=0) |
| 350 | +fig, axs = plot.subplots(ncols=2, nrows=2, refwidth=1.8, share=0) |
351 | 351 | axs.format(suptitle='Axis scales demo', ytickminor=True) |
352 | 352 |
|
353 | 353 | # Linear and log scales |
|
387 | 387 | # %% |
388 | 388 | import proplot as plot |
389 | 389 | import numpy as np |
390 | | -fig, axs = plot.subplots(width=6, nrows=4, aspect=(5, 1), sharex=False) |
| 390 | +fig, axs = plot.subplots(nrows=4, refaspect=(5, 1), figwidth=6, sharex=False) |
391 | 391 | ax = axs[0] |
392 | 392 |
|
393 | 393 | # Sample data |
|
427 | 427 | import proplot as plot |
428 | 428 | import numpy as np |
429 | 429 | plot.rc.reset() |
430 | | -fig, axs = plot.subplots(nrows=2, ncols=3, axwidth=1.7, share=0, order='F') |
| 430 | +fig, axs = plot.subplots(nrows=2, ncols=3, refwidth=1.7, share=0, order='F') |
431 | 431 | axs.format( |
432 | 432 | toplabels=('Power scales', 'Exponential scales', 'Cartographic scales'), |
433 | 433 | ) |
|
502 | 502 | c2 = plot.scale_luminance('red', 0.5) |
503 | 503 | fig, axs = plot.subplots( |
504 | 504 | [[1, 1, 2, 2], [0, 3, 3, 0]], |
505 | | - share=0, aspect=2.2, axwidth=3 |
| 505 | + share=0, refaspect=2.2, refwidth=3 |
506 | 506 | ) |
507 | 507 | axs.format( |
508 | 508 | suptitle='Duplicate axes with custom transformations', |
|
540 | 540 | plot.rc.update({'grid.alpha': 0.4, 'linewidth': 1, 'grid.linewidth': 1}) |
541 | 541 | c1 = plot.scale_luminance('cerulean', 0.5) |
542 | 542 | c2 = plot.scale_luminance('red', 0.5) |
543 | | -fig, axs = plot.subplots(ncols=2, share=0, aspect=0.4, axwidth=1.8) |
| 543 | +fig, axs = plot.subplots(ncols=2, share=0, refaspect=0.4, refwidth=1.8) |
544 | 544 | axs.format(suptitle='Duplicate axes with special transformations') |
545 | 545 |
|
546 | 546 | # Pressure as the linear scale, height on opposite axis (scale height 7km) |
|
570 | 570 | plot.rc.margin = 0 |
571 | 571 | c1 = plot.scale_luminance('cerulean', 0.5) |
572 | 572 | c2 = plot.scale_luminance('red', 0.5) |
573 | | -fig, ax = plot.subplots(aspect=(3, 1), width=6) |
| 573 | +fig, ax = plot.subplots(refaspect=(3, 1), figwidth=6) |
574 | 574 |
|
575 | 575 | # Sample data |
576 | 576 | cutoff = 1 / 5 |
|
0 commit comments