Skip to content

Option to add individual color bar for each variable when using the Faceting  #7369

Open
@WalidGharianiEAGLE

Description

@WalidGharianiEAGLE

Is your feature request related to a problem?

I think such feature can be very useful specially when we have different variables (example Normalized Difference Vegetation Index (NDVI) and land surface temperature (LST) which have different values) rather than a common color bar.

%matplotlib inline
import numpy as np
import pandas as pd
import xarray as xr
import matplotlib.pyplot as plt

airtemps = xr.tutorial.open_dataset("air_temperature")
air = airtemps.air - 273.15

air.attrs = airtemps.air.attrs

air.attrs["units"] = "deg C"

aot = xr.concat([air.isel(time=0)* .01, air.isel(time=100)], "time")

# assume this is NDVI
(air.isel(time=0)* .01 ).plot()

# ndvi values cant be visualized when there is a common color bar with Faceting
aot.plot(col = 'time')

Describe the solution you'd like

# manual plot
fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12, 5))
for i in [0,1]:
    aot.isel(time=i).plot(ax = axes[i])

Rather than manual plot to adjust each color bar, it will be more efficient to integrate this option automatically when using Faceting

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions