code: def draw_simple_elevation(world, sea_level, target):
      
      e = world.layers['elevation'].data
      c = numpy.empty(e.shape, dtype=numpy.float)
  
      has_ocean = not (sea_level is None or world.layers['ocean'].data is None or not world.layers['ocean'].data.any())  # or 'not any ocean'
      mask_land = numpy.ma.array(e, mask=world.layers['ocean'].data if has_ocean else False)  # only land
  
      min_elev_land = mask_land.min()
      max_elev_land = mask_land.max()
      elev_delta_land = (max_elev_land - min_elev_land) / 11.0
  
      if has_ocean:
          land = numpy.logical_not(world.layers['ocean'].data)
          mask_ocean = numpy.ma.array(e, mask=land)  # only ocean
          min_elev_sea = mask_ocean.min()
          max_elev_sea = mask_ocean.max()
          elev_delta_sea = max_elev_sea - min_elev_sea
  
          c[world.layers['ocean'].data] = ((e[world.layers['ocean'].data] - min_elev_sea) / elev_delta_sea)
          c[land] = ((e[land] - min_elev_land) / elev_delta_land) + 1
      else:
          c = ((e - min_elev_land) / elev_delta_land) + 1
  
      for y in range(world.height):
          for x in range(world.width):
              r, g, b = elevation_color(c[y, x], sea_level)
              target.set_pixel(x, y, (int(r * 255), int(g * 255),
                                      int(b * 255), 255))
docs: This function can be used on a generic canvas (either an image to save
          on disk or a canvas part of a GUI)