Issue 1:
How can I force color mapping of hue to be qualitative instead of sequential when the data is numeric?

Below is example of what I am trying to graph. I want the Stage data to be plotted with the hue. However, the seaborn interprets the Stage data as numeric thus resulting in sequential color mapping. I want the colors to be mapped to qualitative.

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
%matplotlib widget

# https://elitedatascience.com/wp-content/uploads/2017/04/Pokemon.csv
# https://elitedatascience.com/python-seaborn-tutorial
df = pd.read_csv(u'Pokemon.csv')

# Drop any pokemon without type 2
df.dropna(axis='rows', subset=['Type 2'], how='any', inplace=True)

# Drop few type 2 for example because when using style='Type 2', there aren't enough markers
df = df.loc[ ( (df['Type 2'] != 'Ice') & (df['Type 2'] != 'Water') & (df['Type 2'] != 'Rock') )]

df.head()

sns.relplot(x='HP', y='Attack', hue='Stage', style='Type 2', legend='full', data=df)

If I try to convert the Stage data to string before plotting, I get an error:

df["Stage"] = df["Stage"].astype(str)
sns.relplot(x='HP', y='Attack', hue='Stage', style='Type 2', legend='full', data=df)

Error I get is: AttributeError: 'str' object has no attribute 'view'

However, if I append the Stage after converting to string with another string, I have no issues:

`

df["Stage"] = df["Stage"].astype(str)
df["Stage"] = df["Stage"] + ' | '

Related topics:

https://stackoverflow.com/questions/52884736/why-is-seaborn-creating-an-extra-category-in-my-data

https://stackoverflow.com/questions/51525284/the-hue-parameter-in-seaborn-relplot-skips-an-integer-when-given-numerical-d

Issue 2:
I brought this proposal to matplotlib earlier (matplotlib/matplotlib#18643) but it didn't sound like a good fit. The proposed enhancement was more of a re-casting of one plot type (hist2d) to be used in scenarios where a different one (plot) is the standard, rather than a new fundamental plot type, and therefore not general enough for inclusion in the library. One contributor recommended seeing if it might fit here in seaborn since the API is a little more high-level and aims at building off matplotlib without having to slog through the details. I will just copy/paste the proposal here:

Problem

A while back I was working on a project that involves a bit of time series segmentation/clustering, and found it difficult to visualize my clusters in the "standard" way, which involved simply using plt.plot for each series in my data set and setting alpha to some really low number. I had tens of thousands of such series, and besides taking a long time to run through the loop of plotting some small subsample (plotting everything this way takes an agonizing amount of time), the other major drawback was that apparently there is a lower limit to alpha of 1/256, below which nothing would show up. Even with the setting this low, layering large numbers of time series on top of each other just leads to a solid slab of color that makes it difficult to visualize. Yet another factor is that time series with large slopes (both positive and negative) contribute more heavily than series with small slopes to the color of the plot.

Proposed Solution

I came up with what I think is a fairly nice solution, which is instead of plotting the time series as stacked line plots, to plot them as 2D histograms where each bin counts the number of (potentially interpolated) points that fall in that region. This has a number of advantages:

way faster than stacking line plots because there is only a single artist being drawn

much more flexible color scheme; colors are automatically normalized or can be changed to represent a log scale, etc.

color scheme is actually indicative of the density of points and does not suffer from the bias of time series with high/low slopes

I managed to save the code and kind of forgot about it until now, I have it in a repo here. There is probably a good deal of improvement that can be done, especially with regards to interpolation techniques.

Additional context and prior art

These are some old plots from over a year ago, so I don't have access to the data anymore, but you can probably recreate something similar with the code from the repo linked above. Here are some comparisons of the heat map method (left) and standard stacked line plot (right) on some randomly generated toy data:

An example of same data with different color schemes:

And here are some of the clusters that I was able to find in my data set at the time:

Unfortunately I don't think I'm at liberty to divulge what the data actually represents, but it's monthly data, and you can see that there is a bit of interpolation going on between months in order to give it a more "continuous" look.

So, what do you think? Would this be a helpful new plot type? It's basically built on top of pre-existing plot types, so it is probably not too difficult to implement!