python - 实际处理 pyplot.grid() 函数的源代码?
问题描述
我正在尝试跟踪代码以找出 matplotlib 源代码的哪一部分处理此问题:
import matplotlib.pyplot as plt
...
plt.grid(b=True, which='minor', color='#000000', linestyle='--')
我发现了这个:https ://matplotlib.org/3.1.1/_modules/matplotlib/pyplot.html#grid
但它只是返回gca()
,我找不到源代码中的哪个代码实际上将次要网格线颜色设置为#000000
,它的线样式为--
.
gca
返回gcf
这里:https ://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/pyplot.py#L2204
这会返回,figure
但那时我迷路了,找不到在plt.grid()
调用函数时设置次要网格线样式的源代码。
(我确实知道/相信可以在此处找到通过 rcParams 处理更改主要网格线样式的源代码:https ://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py )
谢谢!
解决方案
推荐阅读
- sql - Oracle 问题将工作 SQL 移植到过程
- javascript - 如何将 ref 属性传递给情感 js 中的组件?
- php - Laravel 8 站点在 localhost 上运行良好,但在共享托管服务器上运行良好
- c++ - 为什么 constexpr 方法可以正确返回在执行过程中值发生变化的类成员?
- couchbase - CouchBase 同步网关同步
- firebase - 页面加载时未调用 Flutter Getx Controller onInit 方法
- c# - 罗马尼亚语字符不适用于 ITextSharp
- swift - iPhone 6(非视网膜)与 iPhone 11(视网膜显示)上的 iPhone 彩色显示问题
- html - Flex div 在 iphone xr 上被忽略
- javascript - 使用 Javascript 根据包含的图像源删除 div