For display fig

Sir , for display a only that part of fig whose pixel of some particular color .

new_img_exp = np.ones((330*500,3),dtype=‘uint8’)
for ix in range (new_img_exp.shape[0]) :
#print(km.labels_[ix])
if km.labels_[ix] == 1 :
new_img_exp[ix] = colors[km.labels_[ix]]

new_img_exp = new_img_exp.reshape((original_shape))
plt.imshow(new_img_exp)

Is this correct ? Here , rest of the notations are same as in code .

hey @shubhambarnwal02 ,
to be honest , by just reading the code like the above one , i can’t say whether the output will be correct or not as you are expecting.

Is your output coming different as you wanted it to be ?
if so , then show me what you are getting, and also let me know , what you actually wanted.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.