Skip to content

Dynamic default colormaps #690

@andreas-wuestefeld

Description

@andreas-wuestefeld

patch.viz.waterfall() is a powerful tool, creating beautiful figures.
the default "bwr" colormap is great for plotting waveforms (although 'RdBu' is visually more pleasing to me )
Viridis is standard, but also overused.

However, when looking at transformed data, it may be better to have dedicated default colormaps for each transform.

This can be handled in the waterfall function itself, using the "data_type" attribute of the patch. Something like

if "data_type" == 'strain_rate":
    cmap = 'RdBu_r'
if "data_type" == 'strain":
    cmap = 'seismic'
elif  "data_type" == 'FBE":
    cmap = 'Spectral_r'
elif  "data_type" == 'stalta":
    cmap = 'RdGy_r'
elif  "data_type" == 'spectrogam":
    cmap = 'inferno'
else:
    cmap = 'bwr'

This can be handled more efficiently in a map, but this was just to illustrate.

One advantage I see is that it is clear already from the colormap what type of data you are looking at; no need to read the caption or labels. There is a tendency to use viridis for everything, and that is not intuitive.

Any thoughts if this would be a desirable behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions