1
$\begingroup$

Here is my diagrams, enter image description here

I want to remove the labels of the second bar that is C1,C2,C3,C4,C5, because it is repeating.

$\endgroup$

2 Answers 2

1
$\begingroup$

You could try:

plt.gca().legend.set_visible(False)

or

plt.gca().legend.remove()

I think.

$\endgroup$
0
$\begingroup$

I think for your case, you need to define them as categories as follows

import pandas as pd
unique_cat = ['C1','C2','C3','C4','C5']
data['Accuracy'] = pd.Categorical(data['Accuracy'], categories = unique_cat)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.