rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.85k stars 857 forks source link

Changing text color property in confusion matrix #824

Closed tobilab closed 3 years ago

tobilab commented 3 years ago

This issue refers to the confusion matrix method: http://rasbt.github.io/mlxtend/api_subpackages/mlxtend.plotting/#plot_confusion_matrix

If the colormap is changed ( cmap property) the text color of the figure remains white. However, depending on the selected color map this leads to unreadable conf. matrices.

Can you please add a property to set the font color?

rasbt commented 3 years ago

Good point. I added a fontcolor_threshold that can be adjusted for different color maps or can just be set such that the text color is all white or black. E.g., have a look at Example 5: https://github.com/rasbt/mlxtend/blob/master/docs/sources/user_guide/plotting/plot_confusion_matrix.ipynb

tobilab commented 3 years ago

Great i will try. Thank U.

rasbt commented 3 years ago

Quick note: I haven't made a new release since then, but you can install the recent development version via

pip install git+git://github.com/rasbt/mlxtend.git
tobilab commented 3 years ago

Quick note: I haven't made a new release since then, but you can install the recent development version via

pip install git+git://github.com/rasbt/mlxtend.git

Thanks, perfect :)