code: def draw_geoscale(ax, minx=0, maxx=175):
      
      a, b = .1, .6  # Correspond to 200mya and 0mya
      def cv(x): return b - (x - b) / (maxx - minx) * (b - a)
      ax.plot((a, b), (.5, .5), "k-")
      tick = .015
      for mya in xrange(maxx - 25, 0, -25):
          p = cv(mya)
          ax.plot((p, p), (.5, .5 - tick), "k-")
          ax.text(p, .5 - 2.5 * tick, str(mya), ha="center", va="center")
      ax.text((a + b) / 2, .5 - 5 * tick, "Time before present (million years)",
              ha="center", va="center")
  
      # Source:
      # http://www.weston.org/schools/ms/biologyweb/evolution/handouts/GSAchron09.jpg
      Geo = (("Neogene", 2.6, 23.0, "#fee400"),
             ("Paleogene", 23.0, 65.5, "#ff9a65"),
             ("Cretaceous", 65.5, 145.5, "#80ff40"),
             ("Jurassic", 145.5, 201.6, "#33fff3"))
      h = .05
      for era, start, end, color in Geo:
          start, end = cv(start), cv(end)
          end = max(a, end)
          p = Rectangle((end, .5 + tick / 2), abs(start - end),
                        h, lw=1, ec="w", fc=color)
          ax.text((start + end) / 2, .5 + (tick + h) / 2, era,
                  ha="center", va="center", size=9)
          ax.add_patch(p)
docs: Draw geological epoch on million year ago (mya) scale.