I've been using sizelegend and catlegend recently and ran into a few issues. I initially intended to fix them myself and submit a PR, but as I continued testing, I became increasingly confused. So, I'm writing this as a suggestion for your reference instead.
The parameters for sizelegend and catlegend are currently inconsistent, mixing singular and plural forms. For example, catlegend accepts both colors and color: the former takes a list (mapping to every entry), while the latter accepts a single color applied to all entries. However, it only accepts facecolor (whose value can be a list for every entry) but does not accept the plural form facecolors. And sizelegend only accept color but not colors. I tested a portion of this and did some source code digging, but I quickly got lost in the value parser and argument check functions.
If my explanation isn't clear enough, I suggest you test the following parameters separately for catlegend and sizelegend:
color, colors, facecolor, facecolors, markerfacecolor, markerfacecolors, edgecolor, markeredgecolor, markeredgewidth, etc.
Suggestions:
- There is already function like
_style_lookup that matches a list (or dict) of values to every entry. I suggest using strictly singular parameters and dropping the plural forms like colors, sizes.
- Semantic legend functions support all marker arguments, such as
size, markersize, color, facecolor, edgecolor, markerfacecolor, markeredgecolor, markeredgewidth, alpha, etc.
- Support all argument aliases, such as:
ms, c, mfc, mec, fc, ec, mew, etc
- Ensure all arguments about marker styles support both (now some args like labels and colors does, and some like edgecolor doesn't):
- a single value applied to all entries,
- a list (or dict) of values applied to each individual entry.
I've been using
sizelegendandcatlegendrecently and ran into a few issues. I initially intended to fix them myself and submit a PR, but as I continued testing, I became increasingly confused. So, I'm writing this as a suggestion for your reference instead.The parameters for
sizelegendandcatlegendare currently inconsistent, mixing singular and plural forms. For example,catlegendaccepts bothcolorsandcolor: the former takes a list (mapping to every entry), while the latter accepts a single color applied to all entries. However, it only acceptsfacecolor(whose value can be a list for every entry) but does not accept the plural formfacecolors. Andsizelegendonly acceptcolorbut notcolors. I tested a portion of this and did some source code digging, but I quickly got lost in the value parser and argument check functions.If my explanation isn't clear enough, I suggest you test the following parameters separately for
catlegendandsizelegend:color,colors,facecolor,facecolors,markerfacecolor,markerfacecolors,edgecolor,markeredgecolor,markeredgewidth, etc.Suggestions:
_style_lookupthat matches a list (or dict) of values to every entry. I suggest using strictly singular parameters and dropping the plural forms likecolors,sizes.size,markersize,color,facecolor,edgecolor,markerfacecolor,markeredgecolor,markeredgewidth,alpha, etc.ms,c,mfc,mec,fc,ec,mew, etc