You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A useful argument, labelcolor, was introduced in version 3.3.0 for the textual labels in legends. This allows users to color these labels with the same color as the underlying line/marker, which in turn, allows user to remove the line/marker handle/icon in favor of the colored text label.
In settings where figures are produced in a very standardized manner and that manner requires the color of the legend labels standing in for the line/marker colors of the figure, a more compact representation, the requested feature would reduce coding burden for individuals, and more importantly reduce the burden among collaborators.
Proposed Solution
A logical extension of this great addition to plt.legend would be to (if possible) include the labelcolor option/argument in the matplotlib style sheet. Allowing legend.labelcolor: linecolor along with the various other options available to labelcolor in plt.legend() into the stylesheet could reduce some coding overhead and coordination issues where legends of this type (label color standing in as line/marker) are needed, especially in teams.
Additional context and prior art
The text was updated successfully, but these errors were encountered:
To implement this we would have to add an rcparam for legend.labelcolor (as that is the machinery that the style files feed into). A recent example of adding a new rcparams is: #17022 . The work is to:
add the validation code for the new value
add the default value to the matplotlbrc template
add the checking of the rcparam at the correct place in the code
document the new feature
Would you like to take a shot at implementing this @luke-m-olson ?
A useful argument, labelcolor, was introduced in version 3.3.0 for the textual labels in legends. This allows users to color these labels with the same color as the underlying line/marker, which in turn, allows user to remove the line/marker handle/icon in favor of the colored text label.
In settings where figures are produced in a very standardized manner and that manner requires the color of the legend labels standing in for the line/marker colors of the figure, a more compact representation, the requested feature would reduce coding burden for individuals, and more importantly reduce the burden among collaborators.
Proposed Solution
A logical extension of this great addition to
plt.legend
would be to (if possible) include thelabelcolor
option/argument in the matplotlib style sheet. Allowinglegend.labelcolor: linecolor
along with the various other options available tolabelcolor
inplt.legend()
into the stylesheet could reduce some coding overhead and coordination issues where legends of this type (label color standing in as line/marker) are needed, especially in teams.Additional context and prior art
The text was updated successfully, but these errors were encountered: