LinkedEarth / Pyleoclim_util

Python Package for the Analysis of Paleoclimate Data. Documentation at
https://pyleoclim-util.readthedocs.io
GNU General Public License v3.0
84 stars 32 forks source link

Dashboard not respecting default plot colors #598

Closed khider closed 1 month ago

khider commented 1 month ago

Describe the bug Dashboard doesn't seem to understand the color/marker for the plots (maps are ok)

To Reproduce

import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
from pylipd import LiPD

# For insolation curves, let's use climlab
from climlab.solar.orbital import OrbitalTable
from climlab.solar.insolation import daily_insolation

pyleo.set_style('web') #set the figure style

import warnings
warnings.filterwarnings('ignore')

D = LiPD()
D.load('./data/ODP846.Lawrence.2006.lpd')

df = D.get_timeseries_essentials()
df.head()

row = df[df['paleoData_variableName']=='temp muller'].reset_index() #select the proper row and re-index it to zero so we can select it easily

ts = pyleo.GeoSeries(time=row['time_values'][0], value = row['paleoData_values'][0], time_name= 'Age', time_unit = row['time_units'][0],
                     value_name = 'Sea Surface Temperature', value_unit = '$^\circ$C', lat = row['geo_meanLat'][0],
                     lon = row['geo_meanLon'][0], elevation = row['geo_meanElev'][0], label = row['dataSetName'][0], 
                     archiveType = row['archiveType'][0], depth = row['depth_values'][0], depth_name = row['depth_variableName'][0],
                     depth_unit = row['depth_units'],verbose = False)

ts.dashboard(plt_kwargs={'marker':None})

Produces:

image

Expected behavior Should plot in brown for the marine sediment

khider commented 1 month ago

Maps seems to do fuzzy matching while the rest doesn't. There is a directive to try to standardize the archive type when instantiating a GeoSeries. It's set to False by default so the name doesn't get replaced. But should the figure try to fuzzy match to something known?

@CommonClimate any opinion?

khider commented 1 month ago

Addressed by https://github.com/LinkedEarth/Pyleoclim_util/commit/5ad1375e7eec7957708f69c755eedf397416add8