<p dir="auto">Hi,<br>
Is it possible to customize the legend of an object interface? Right now I'm trying a variety of ways to access it via the matplotlib axes and figures, but nothing changes the legend.</p>
<p dir="auto">g = (so.Plot(ange_surv, x='Week ', y='GWC',<br>
color='Treatment ')<br>
.add(so.Dot(alpha = 0.35), so.Jitter(), so.Dodge())<br>
.add(so.Range(linewidth=2), so.Est(errorbar=('se', 1)), so.Dodge())<br>
.add(so.Dot(pointsize=12), so.Agg(), so.Dodge())<br>
.label(x='Week of Experiment', y='GWC')<br>
.theme(sns_theme)<br>
)<br>
f = plt.figure()<br>
res = g.on(f).plot()<br>
ax = f.axes[0]<br>
ax.legend(ncols=2, loc=2, bbox_to_anchor=(1.01, 1.01))<br>
plt.show()</p>
<p dir="auto">And the matplotlib rcparams don't allow for fine-tuning.</p>
<p dir="auto">There's not much ability to customize how the <code class="notranslate">Plot</code> legend appears, beyond what's available through <code class="notranslate">Plot.theme</code>. Desiderata include:</p>
<ul dir="auto">
<li>Control over position</li>
<li>Control over number of columns and location of title</li>
<li>Potential for independent drawing / localization of legends for distinct properties</li>
<li>Appearance of mapped properties on legend artists for other properties. In other words, If you map color and pointsize to different variables, the pointsize artists will appear in <code class="notranslate">C0</code> even if that doesn't appear in the plot. (This probably needs both better defaults and more customizability).</li>
</ul>