Demo USGS patternsΒΆ

  • 601, 602, 603, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644
  • 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686
  • 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733
import itertools
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
# import mpl_visual_context.patheffects as pe

from mpl_pe_pattern_usgs import PatternUSGS

pm = PatternUSGS()

kk = [k for k in sorted(pm.roots.keys()) if k > "600"]

while kk:
    fig = plt.figure(figsize=(6, 7))
    gs = fig.add_gridspec(7, 6)

    for gs1 in gs:
        ax = fig.add_subplot(gs1)
        ax.axis("off")

        patch = Rectangle((0, 0), 1, 1,
                          fc="k", ec="k", transform=ax.transAxes,
                          )
        ax.add_patch(patch)

        if kk:
            k = kk.pop(0)
            pattern = pm.get(k, scale=4)
            patch.set_path_effects([# pe.FillOnly(),
                pattern.fill(ax),
            ])

            ax.set_title(k)
        else:
            break

    fig.tight_layout()

plt.show()

Total running time of the script: (0 minutes 4.219 seconds)

Gallery generated by Sphinx-Gallery