import matplotlib.pyplot as plt
import numpy as npdefplot_pie_chart(data, labels, title="Pie Chart"):"""绘制饼状图。:param data: 包含数值的列表。:param labels: 与数据相对应的标签列表。:param title: 图表的标题。"""fig, ax = plt.subplots()ax.pie(data, labels=labels, autopct='%1.1f%%', startangle=140)ax.axis('equal')# Equal aspect ratio ensures the pie chart is circular.plt.title(title)plt.show()# 示例数据
pie_data =[35,25,25,15]
pie_labels =['Category A','Category B','Category C','Category D']# 绘制图表
plot_pie_chart(pie_data, pie_labels, title="Example Pie Chart")
import matplotlib.pyplot as plt
import numpy as npdefplot_donut_chart(data, labels, title="Donut Chart"):"""绘制环形图。:param data: 包含数值的列表。:param labels: 与数据相对应的标签列表。:param title: 图表的标题。"""fig, ax = plt.subplots()ax.pie(data, labels=labels, autopct='%1.1f%%', startangle=140, pctdistance=0.85)# Draw a circle at the center of pie to make it look like a donutcentre_circle = plt.Circle((0,0),0.70,fc='white')fig = plt.gcf()fig.gca().add_artist(centre_circle)ax.axis('equal')# Equal aspect ratio ensures the pie chart is circular.plt.title(title)plt.show()# 示例数据
pie_data =[35,25,25,15]
pie_labels =['Category A','Category B','Category C','Category D']# 绘制图表
plot_donut_chart(pie_data, pie_labels, title="Example Donut Chart")
目录 LVS群集简介
群集的含义和应用场景
性能扩展方式
群集的分类
负载均衡(LB)
高可用(HA)
高性能运算(HPC)
LVS的三种工作模式
NAT 地址转换
TUN IP隧道 IP Tunnel
DR 直接路由 Direct Rout…