membership function membership function in fuzzy algorithm and the place of the legend is wrong how I can change it’s place
Advertisement
Answer
For your image if you use matplotlib, using loc=’upper center’ or loc=’best’
JavaScript
x
12
12
1
import numpy as np
2
import matplotlib.pyplot as plt
3
4
plt.plot(x, y1, label ='1')
5
plt.plot(x, y2, label ='2')
6
7
# Function add a legend
8
plt.legend(loc='upper center')
9
10
# function to show the plot
11
plt.show()
12
But if you want to put it in a specific x,y coordinate
JavaScript
1
2
1
plt.legend(loc='upper right', bbox_to_anchor=(x, y))
2