旁路由无法访问B站的解决方案

由于一些上网特殊需求我给家里弄的是旁路由的上网方案,最近发现通过网线连接的设备无法访问国内网站,但是wifi设备却不影响。
查了一些资料之后可能跟旁路由不对称路由有关,解决方案如下:
登录旁路由服务器页面(以openwrt为例),打开网络——防火墙——常规设置
关闭 启用 SYN-food 防御(可能有效)和丢弃无效数据包(重要)
在这里插入图片描述
再拉到最底下区域页面,勾选IP动态伪装
在这里插入图片描述
然后就能流畅访问国内网站了

### Matplotlib 练习题及答案 以下是基于引用内容整理的一系列 Matplotlib 练习题及其解答: #### 练习 1: 折线图绘制 编写程序绘制函数 \(y = \sin(x)\),其中 \(x\) 范围为 `[0, 2π]`。 ```python import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2 * np.pi, 500) y = np.sin(x) plt.plot(x, y, label='Sin Curve') plt.title('Sine Wave', fontsize=16) plt.xlabel('X-axis', fontsize=14) plt.ylabel('Y-axis', fontsize=14) plt.legend() plt.grid(True) plt.show() ``` --- #### 练习 2: 散点图绘制 绘制一组随机生成的数据点作为散点图,并设置不同的颜色和大小。 ```python np.random.seed(42) x = np.random.rand(50) y = np.random.rand(50) colors = np.random.rand(50) sizes = 1000 * np.random.rand(50) plt.scatter(x, y, c=colors, s=sizes, alpha=0.5) plt.title('Scatter Plot with Random Data Points', fontsize=16) plt.colorbar(label='Color Intensity') plt.show() ``` --- #### 练习 3: 堆叠柱状图 给定两组数据,分别表示两个类别的销售额,绘制堆叠柱状图。 ```python categories = ['A', 'B', 'C'] sales_2022 = [10, 15, 7] sales_2023 = [12, 9, 11] bar_width = 0.35 index = np.arange(len(categories)) plt.bar(index, sales_2022, bar_width, label='2022 Sales') plt.bar(index + bar_width, sales_2023, bar_width, label='2023 Sales') plt.xticks(index + bar_width / 2, categories) plt.title('Stacked Bar Chart of Sales by Year', fontsize=16) plt.xlabel('Categories', fontsize=14) plt.ylabel('Sales (Units)', fontsize=14) plt.legend() plt.show() ``` --- #### 练习 4: 极坐标图 绘制一个简单的极坐标图,展示角度与半径的关系。 ```python theta = np.linspace(0, 2 * np.pi, 100) r = theta ** 2 ax = plt.subplot(111, polar=True) ax.plot(theta, r, color='red', linewidth=2) ax.set_title('Polar Coordinate Example', va='bottom', fontsize=16) plt.show() ``` --- #### 练习 5: 双 Y 轴图 在同一张图表中绘制两条曲线,每条曲线对应一个独立的 Y 轴。 ```python fig, ax1 = plt.subplots() x = np.arange(0, 10, 0.1) y1 = np.exp(x) y2 = np.log(x + 1) color = 'tab:red' ax1.set_xlabel('X-axis', fontsize=14) ax1.set_ylabel('Exponential Growth', color=color, fontsize=14) ax1.plot(x, y1, color=color) ax1.tick_params(axis='y', labelcolor=color) ax2 = ax1.twinx() color = 'tab:blue' ax2.set_ylabel('Logarithmic Growth', color=color, fontsize=14) ax2.plot(x, y2, color=color) ax2.tick_params(axis='y', labelcolor=color) plt.title('Dual-Y Axis Plot', fontsize=16) fig.tight_layout() plt.show() ``` --- 以上练习涵盖了常见的 Matplotlib 图表类型以及其基本操作方法[^2]。通过这些例子可以熟悉如何使用 `pyplot` 接口完成不同类型的数据可视化任务。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值