Add paleogeography mask in scatter data plot#

This example shows how to add paleogeography mask according to input age

plot paleomask
/home/docs/checkouts/readthedocs.org/user_builds/cgeniepy/envs/stable/lib/python3.12/site-packages/cgeniepy/plot.py:632: UserWarning: kind is not used for map plotting
  warnings.warn("kind is not used for map plotting")

<matplotlib.collections.PathCollection object at 0x7d6f32350e90>

from cgeniepy.table import ScatterData
import pandas as pd
import numpy as np

# Generate random data
np.random.seed(1239124)  # Set seed for reproducibility

# Create random latitude, longitude, and variable values
random_data = pd.DataFrame({
    'lat': np.random.uniform(-90, 90, 100),
    'lon': np.random.uniform(-180, 180, 100),
    'dummy_var': np.random.random(100) * 100
})

# Convert to ScatterData object
random_data = ScatterData(random_data)

# Set MultiIndex for the data
random_data.set_index(['lat', 'lon'])

# Plot with specified parameters
random_data.plot(var='dummy_var', edgecolor='k', mask_age=100)

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

Gallery generated by Sphinx-Gallery