<p dir="auto">I am trying to use seaborn in a python standard shell environment , but I always get an error when I use the basis palette function</p>
<p dir="auto">sns.palplot(sns.diverging_palette(240, 10, n=9))</p>
<p dir="auto">any Idea from where this could come from ???</p>
<p dir="auto">Traceback (most recent call last):<br>
File "C:\Users\meyringer\AppData\Local\Programs\Python\Python37-32\lib\site-packages\numpy\core\function_base.py", line 117, in linspace<br>
num = operator.index(num)<br>
TypeError: 'float' object cannot be interpreted as an integer</p>
<p dir="auto">During handling of the above exception, another exception occurred:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "C:/Users/meyringer/AppData/Local/Programs/Python/Python37-32/seabornpalette.py", line 3, in <br>
sns.palplot(sns.diverging_palette(240, 10, n=9))<br>
File "C:\Users\meyringer\AppData\Local\Programs\Python\Python37-32\lib\site-packages\seaborn\palettes.py", line 744, in diverging_palette<br>
neg = palfunc((h_neg, s, l), 128 - (sep / 2), reverse=True, input="husl")<br>
File "C:\Users\meyringer\AppData\Local\Programs\Python\Python37-32\lib\site-packages\seaborn\palettes.py", line 641, in light_palette<br>
return blend_palette(colors, n_colors, as_cmap)<br>
File "C:\Users\meyringer\AppData\Local\Programs\Python\Python37-32\lib\site-packages\seaborn\palettes.py", line 777, in blend_palette<br>
pal = _ColorPalette(pal(np.linspace(0, 1, n_colors)))<br>
File "&lt;<strong>array_function</strong> internals&gt;", line 6, in linspace<br>
File "C:\Users\meyringer\AppData\Local\Programs\Python\Python37-32\lib\site-packages\numpy\core\function_base.py", line 121, in linspace<br>
.format(type(num)))<br>
TypeError: object of type &lt;class 'float'&gt; cannot be safely interpreted as an integer.</p>
<p dir="auto">When using <code class="notranslate">row_template</code> on FactorGrid when <code class="notranslate">margin_titles=True</code>, row_template will not render correctly as the earlier call to finalize_grid already creates an annotated text for the row margin (See: <a href="https://github.com/mwaskom/seaborn/blob/v0.7.1/seaborn/axisgrid.py#L731">https://github.com/mwaskom/seaborn/blob/v0.7.1/seaborn/axisgrid.py#L731</a>)</p>
<p dir="auto">I think a fix will be to add a switch to map function which will ask if titles need to created. Another, option will be to keep track of the created row titles and edit their text (as they are created using ax.annotate <a href="https://github.com/mwaskom/seaborn/blob/v0.7.1/seaborn/axisgrid.py#L939">https://github.com/mwaskom/seaborn/blob/v0.7.1/seaborn/axisgrid.py#L939</a>)</p>
<p dir="auto">Code for replication:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df = pd.DataFrame(np.random.choice([&quot;a&quot;, &quot;b&quot;, &quot;c&quot;], size=(10,2)), columns=[&quot;col1&quot;, &quot;col2&quot;])
df[&quot;col_value&quot;]=np.random.randint(10, size=df.shape[0])
g = (sns.FacetGrid(row=&quot;col1&quot;, col=&quot;col2&quot;, aspect=1.5, margin_titles=True,
                  data=df)
g = g.map(plt.hist, &quot;col_value&quot;, bins=range(10))
g = g.set_titles(template=&quot;&quot;, col_template=&quot;{col_name}&quot;, row_template=&quot;{row_name}&quot;)
g.fig.tight_layout()"><pre class="notranslate"><code class="notranslate">df = pd.DataFrame(np.random.choice(["a", "b", "c"], size=(10,2)), columns=["col1", "col2"])
df["col_value"]=np.random.randint(10, size=df.shape[0])
g = (sns.FacetGrid(row="col1", col="col2", aspect=1.5, margin_titles=True,
                  data=df)
g = g.map(plt.hist, "col_value", bins=range(10))
g = g.set_titles(template="", col_template="{col_name}", row_template="{row_name}")
g.fig.tight_layout()
</code></pre></div>