Advertisement
gandalfbialy

Untitled

Apr 12th, 2025
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. # Punkty charakterystyczne
  2. points_x = [10, 20, 30, 40]
  3. points_y = fuzzy_comfort(np.array(points_x))
  4. labels = ['a (10°C)', 'b (20°C)', 'c (30°C)', 'd (40°C)']
  5.  
  6. # Rysowanie wykresu
  7. plt.figure(figsize=(10, 5))
  8. plt.plot(x, mu_comfort, label='Temperatura komfortowa', color='green')
  9. plt.scatter(points_x, points_y, color='black', zorder=5)
  10.  
  11. # Etykiety
  12. for i, label in enumerate(labels):
  13.     plt.annotate(label, (points_x[i], points_y[i] + 0.05), ha='center')
  14.  
  15. plt.title('Funkcja przynależności: Temperatura komfortowa (trapez: 10, 20, 30, 40)')
  16. plt.xlabel('Temperatura [°C]')
  17. plt.ylabel('Przynależność')
  18. plt.grid(True)
  19. plt.legend()
  20. plt.ylim(0, 1.1)
  21. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement