A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mpl-visual-context.readthedocs.io/en/latest/examples/path_effects/test_color_matrix.html below:

Website Navigation


Color Matrix — mpl_visual_context 0.9.3 documentation

Color Matrix
/home/docs/checkouts/readthedocs.org/user_builds/mpl-visual-context/checkouts/latest/examples/path_effects/test_color_matrix.py:33: FutureWarning:

Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `y` variable to `hue` and set `legend=False` for the same effect.

  sns.countplot(y="species", data=df_peng, ax=ax, palette="Blues")
/home/docs/checkouts/readthedocs.org/user_builds/mpl-visual-context/checkouts/latest/examples/path_effects/test_color_matrix.py:33: FutureWarning:

Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `y` variable to `hue` and set `legend=False` for the same effect.

  sns.countplot(y="species", data=df_peng, ax=ax, palette="Blues")
/home/docs/checkouts/readthedocs.org/user_builds/mpl-visual-context/checkouts/latest/examples/path_effects/test_color_matrix.py:33: FutureWarning:

Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `y` variable to `hue` and set `legend=False` for the same effect.

  sns.countplot(y="species", data=df_peng, ax=ax, palette="Blues")
/home/docs/checkouts/readthedocs.org/user_builds/mpl-visual-context/checkouts/latest/examples/path_effects/test_color_matrix.py:33: FutureWarning:

Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `y` variable to `hue` and set `legend=False` for the same effect.

  sns.countplot(y="species", data=df_peng, ax=ax, palette="Blues")
/home/docs/checkouts/readthedocs.org/user_builds/mpl-visual-context/checkouts/latest/examples/path_effects/test_color_matrix.py:33: FutureWarning:

Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `y` variable to `hue` and set `legend=False` for the same effect.

  sns.countplot(y="species", data=df_peng, ax=ax, palette="Blues")
/home/docs/checkouts/readthedocs.org/user_builds/mpl-visual-context/checkouts/latest/examples/path_effects/test_color_matrix.py:33: FutureWarning:

Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `y` variable to `hue` and set `legend=False` for the same effect.

  sns.countplot(y="species", data=df_peng, ax=ax, palette="Blues")
import matplotlib.pyplot as plt
import seaborn as sns

# sns.color_palette("rocket")

from matplotlib.gridspec import GridSpec
from mpl_visual_context.patheffects import ColorMatrix as CM


def main():
    df_peng = sns.load_dataset("penguins")

    color_matrix = CM.color_matrix

    pe_list = [("original", [])] + [(k, [CM(k)]) for k in color_matrix]

    nn = len(pe_list)
    ncol = 3
    nrow = (nn - 1) // ncol + 1

    fig = plt.figure(figsize=(3 * ncol, 2 * nrow), layout="constrained")
    gs = GridSpec(nrow, ncol, figure=fig)

    for gs1, (k, pe) in zip(gs, pe_list):
        ax = fig.add_subplot(gs1)

        sns.countplot(y="species", data=df_peng, ax=ax, palette="Blues")
        ax.set_title(k)

        for p in ax.patches:
            p.set_path_effects(pe)

    plt.show()


if __name__ == '__main__':
    main()

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

Gallery generated by Sphinx-Gallery


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4