rsplotlib 0.1.9__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rsplotlib/core/api.py ADDED
@@ -0,0 +1,728 @@
1
+ """rsplotlib API 完整函数定义
2
+
3
+ 此模块包含 rsplotlib 库所有函数的 Python 包装,显示完整的参数签名和默认值。
4
+ """
5
+
6
+ # 使用别名导入原始模块,避免与包装函数重名
7
+ from .. import rsplotlib as _rsplotlib
8
+ # 导入原始类
9
+ from ..rsplotlib import Figure, Axes
10
+ import warnings as _warnings
11
+
12
+
13
+ # ==================== 内部辅助函数 ====================
14
+
15
+ def _to_list(obj):
16
+ """将 numpy 数组或其他可迭代对象转换为 Python list"""
17
+ if obj is None:
18
+ return None
19
+ if hasattr(obj, 'tolist'):
20
+ return obj.tolist()
21
+ if isinstance(obj, (list, tuple)):
22
+ return list(obj)
23
+ return obj
24
+
25
+
26
+ def _to_list_recursive(obj):
27
+ """递归转换嵌套的 numpy 数组为 Python list"""
28
+ if obj is None:
29
+ return None
30
+ if hasattr(obj, 'tolist'):
31
+ return obj.tolist()
32
+ if isinstance(obj, (list, tuple)):
33
+ return [_to_list_recursive(item) for item in obj]
34
+ return obj
35
+
36
+
37
+ # ==================== 绘图函数 ====================
38
+
39
+ def plot(x, y, label=None, color=None, linestyle=None, marker=None, linewidth=None,
40
+ c=None, lw=None, ls=None, markersize=None, markeredgewidth=None,
41
+ solid_capstyle=None):
42
+ """绘制折线图
43
+
44
+ Args:
45
+ x: x 轴数据
46
+ y: y 轴数据
47
+ label: 图例标签 (默认: None)
48
+ color: 颜色 (默认: None, 使用默认色循环)
49
+ linestyle: 线型 (默认: None, 实线)
50
+ marker: 标记样式 (默认: None)
51
+ linewidth: 线宽 (默认: None)
52
+ c: color 的 matplotlib 别名
53
+ lw: linewidth 的 matplotlib 别名
54
+ ls: linestyle 的 matplotlib 别名
55
+ markersize: 标记大小
56
+ markeredgewidth: 标记边缘宽度
57
+ solid_capstyle: 端点形状 ('butt' | 'round' | 'projecting')
58
+ """
59
+ # 别名兜底:如果只传了 c/lw/ls 而主参数为 None,使用别名
60
+ if color is None and c is not None:
61
+ color = c
62
+ if linewidth is None and lw is not None:
63
+ linewidth = lw
64
+ if linestyle is None and ls is not None:
65
+ linestyle = ls
66
+ return _rsplotlib.plot(
67
+ _to_list(x), _to_list(y),
68
+ label, color, linestyle, marker, linewidth,
69
+ lw, c, ls, markersize, markeredgewidth, solid_capstyle,
70
+ )
71
+
72
+
73
+ def scatter(x, y, s=20.0, c=None, marker='o', label=None, alpha=1.0, color=None):
74
+ """绘制散点图
75
+
76
+ Args:
77
+ x: x 轴数据
78
+ y: y 轴数据
79
+ s: 点大小 (默认: 20.0)
80
+ c: 颜色 (默认: None)
81
+ marker: 标记样式 (默认: 'o')
82
+ label: 图例标签 (默认: None)
83
+ alpha: 透明度 (默认: 1.0)
84
+ color: 颜色别名 (默认: None)
85
+ """
86
+ # 支持 color 作为 c 的别名
87
+ if c is None and color is not None:
88
+ c = color
89
+ return _rsplotlib.scatter(_to_list(x), _to_list(y), s, c, marker, label, alpha)
90
+
91
+
92
+ def bar(x, height, width=0.8, color=None, label=None):
93
+ """绘制柱状图
94
+
95
+ Args:
96
+ x: x 轴位置
97
+ height: 柱高度
98
+ width: 柱宽度 (默认: 0.8)
99
+ color: 颜色 (默认: None)
100
+ label: 图例标签 (默认: None)
101
+ """
102
+ return _rsplotlib.bar(_to_list(x), _to_list(height), width, color, label)
103
+
104
+
105
+ def barh(y, width, height=0.8, color=None, label=None):
106
+ """绘制水平柱状图
107
+
108
+ Args:
109
+ y: y 轴位置
110
+ width: 柱宽度
111
+ height: 柱高度 (默认: 0.8)
112
+ color: 颜色 (默认: None)
113
+ label: 图例标签 (默认: None)
114
+ """
115
+ return _rsplotlib.barh(_to_list(y), _to_list(width), height, color, label)
116
+
117
+
118
+ def hist(x, bins=10, density=False, label=None, alpha=0.7, color=None):
119
+ """绘制直方图
120
+
121
+ Args:
122
+ x: 数据
123
+ bins: 区间数 (默认: 10)
124
+ density: 是否归一化 (默认: False)
125
+ label: 图例标签 (默认: None)
126
+ alpha: 透明度 (默认: 0.7)
127
+ color: 颜色 (默认: None)
128
+ """
129
+ return _rsplotlib.hist(_to_list_recursive(x), bins, density, label, alpha, color)
130
+
131
+
132
+ def pie(x, labels=None, colors=None, autopct=False):
133
+ """绘制饼图
134
+
135
+ Args:
136
+ x: 数据
137
+ labels: 标签列表 (默认: None)
138
+ colors: 颜色列表 (默认: None)
139
+ autopct: 是否显示百分比 (默认: False)
140
+ """
141
+ # 将 bool 类型的 autopct 转换为字符串格式
142
+ if autopct is True:
143
+ autopct_str = "%1.1f%%"
144
+ elif isinstance(autopct, str):
145
+ autopct_str = autopct
146
+ else:
147
+ autopct_str = None
148
+ return _rsplotlib.pie(_to_list(x), labels, colors, autopct_str)
149
+
150
+
151
+ def boxplot(x, labels=None, vert=True):
152
+ """绘制箱线图
153
+
154
+ Args:
155
+ x: 数据列表
156
+ labels: 标签列表 (默认: None)
157
+ vert: 是否垂直显示 (默认: True)
158
+ """
159
+ return _rsplotlib.boxplot(_to_list_recursive(x), labels, vert)
160
+
161
+
162
+ def fill_between(x, y1, y2=None, color=None, alpha=1.0, label=None):
163
+ """填充区域
164
+
165
+ Args:
166
+ x: x 轴数据
167
+ y1: 上边界
168
+ y2: 下边界 (默认: None, 0)
169
+ color: 颜色 (默认: None)
170
+ alpha: 透明度 (默认: 1.0)
171
+ label: 图例标签 (默认: None)
172
+ """
173
+ return _rsplotlib.fill_between(_to_list(x), _to_list(y1), _to_list(y2), color, alpha, label)
174
+
175
+
176
+ def errorbar(x, y, yerr=None, xerr=None, fmt='o', color=None, label=None, capsize=3.0):
177
+ """绘制误差棒图
178
+
179
+ Args:
180
+ x: x 轴数据
181
+ y: y 轴数据
182
+ yerr: y 方向误差 (默认: None)
183
+ xerr: x 方向误差 (默认: None)
184
+ fmt: 标记格式 (默认: 'o')
185
+ color: 颜色 (默认: None)
186
+ label: 图例标签 (默认: None)
187
+ capsize: 误差帽大小 (默认: 3.0)
188
+ """
189
+ return _rsplotlib.errorbar(_to_list(x), _to_list(y), _to_list(yerr), _to_list(xerr), fmt, color, label, capsize)
190
+
191
+
192
+ def stem(x, y, linefmt=None, markerfmt=None, label=None):
193
+ """绘制茎叶图
194
+
195
+ Args:
196
+ x: x 轴数据
197
+ y: y 轴数据
198
+ linefmt: 茎线样式 (默认: None)
199
+ markerfmt: 标记样式 (默认: None)
200
+ label: 图例标签 (默认: None)
201
+ """
202
+ return _rsplotlib.stem(_to_list(x), _to_list(y), linefmt, markerfmt, label)
203
+
204
+
205
+ def step(x, y, where_='pre', label=None, color=None, linestyle='-', linewidth=1.5):
206
+ """绘制阶梯图
207
+
208
+ Args:
209
+ x: x 轴数据
210
+ y: y 轴数据
211
+ where_: 阶梯位置 ('pre', 'post', 'mid', 默认: 'pre')
212
+ label: 图例标签 (默认: None)
213
+ color: 颜色 (默认: None)
214
+ linestyle: 线型 (默认: '-')
215
+ linewidth: 线宽 (默认: 1.5)
216
+ """
217
+ return _rsplotlib.step(_to_list(x), _to_list(y), where_, label, color, linestyle, linewidth)
218
+
219
+
220
+ def imshow(x, cmap='gray', aspect='auto'):
221
+ """显示图像
222
+
223
+ Args:
224
+ x: 2D 数据数组
225
+ cmap: 色图 (默认: 'gray', 可选: 'hot', 'cool')
226
+ aspect: 纵横比 (默认: 'auto', 可选: 'equal')
227
+ """
228
+ return _rsplotlib.imshow(_to_list_recursive(x), cmap, aspect)
229
+
230
+
231
+ def violinplot(dataset, positions=None, widths=0.5, showmeans=False, showmedians=True):
232
+ """绘制小提琴图
233
+
234
+ Args:
235
+ dataset: 数据集,可以是数组列表或 2D 数组
236
+ positions: 位置数组 (默认: None)
237
+ widths: 小提琴宽度 (默认: 0.5)
238
+ showmeans: 是否显示均值 (默认: False)
239
+ showmedians: 是否显示中位数 (默认: True)
240
+ """
241
+ try:
242
+ return _rsplotlib.violinplot(dataset, positions, widths, showmeans, showmedians)
243
+ except AttributeError:
244
+ _warnings.warn("violinplot is not yet implemented in rsplotlib, using boxplot instead")
245
+ return boxplot(dataset)
246
+
247
+
248
+ def hexbin(x, y, gridsize=100, cmap='hot', bins='log', mincnt=1):
249
+ """绘制六边形分箱图
250
+
251
+ Args:
252
+ x: x 坐标数组
253
+ y: y 坐标数组
254
+ gridsize: 网格大小 (默认: 100)
255
+ cmap: 色图 (默认: 'hot')
256
+ bins: 分箱方式 (默认: 'log')
257
+ mincnt: 最小计数 (默认: 1)
258
+ """
259
+ try:
260
+ return _rsplotlib.hexbin(x, y, gridsize, cmap, bins, mincnt)
261
+ except AttributeError:
262
+ _warnings.warn("hexbin is not yet implemented in rsplotlib, using scatter instead")
263
+ return scatter(x, y, s=10, alpha=0.5)
264
+
265
+
266
+ def contour(X, Y, Z, levels=None, colors=None, linestyles=None):
267
+ """绘制等高线图
268
+
269
+ Args:
270
+ X: x 坐标网格
271
+ Y: y 坐标网格
272
+ Z: z 值数组
273
+ levels: 等高线级别 (默认: None)
274
+ colors: 颜色 (默认: None)
275
+ linestyles: 线型 (默认: None)
276
+ """
277
+ try:
278
+ return _rsplotlib.contour(X, Y, Z, levels, colors, linestyles)
279
+ except AttributeError:
280
+ _warnings.warn("contour is not yet implemented in rsplotlib")
281
+ return None
282
+
283
+
284
+ def contourf(X, Y, Z, levels=None, cmap='coolwarm', alpha=1.0):
285
+ """绘制填充等高线图
286
+
287
+ Args:
288
+ X: x 坐标网格
289
+ Y: y 坐标网格
290
+ Z: z 值数组
291
+ levels: 等高线级别 (默认: None)
292
+ cmap: 色图 (默认: 'coolwarm')
293
+ alpha: 透明度 (默认: 1.0)
294
+ """
295
+ try:
296
+ return _rsplotlib.contourf(X, Y, Z, levels, cmap, alpha)
297
+ except AttributeError:
298
+ _warnings.warn("contourf is not yet implemented in rsplotlib")
299
+ return None
300
+
301
+
302
+ def stackplot(x, *args, labels=None, colors=None, alpha=1.0):
303
+ """绘制堆叠面积图
304
+
305
+ Args:
306
+ x: x 轴数据
307
+ *args: 多个 y 数据数组
308
+ labels: 标签列表 (默认: None)
309
+ colors: 颜色列表 (默认: None)
310
+ alpha: 透明度 (默认: 1.0)
311
+ """
312
+ y_data = list(args) if args else []
313
+ if y_data and len(y_data) == 1 and isinstance(y_data[0], (list, tuple)) and isinstance(y_data[0][0], (list, tuple)):
314
+ y_data = list(y_data[0])
315
+ return _rsplotlib.stackplot(_to_list(x), y_data, labels, colors, alpha)
316
+
317
+
318
+ # ==================== 辅助元素 ====================
319
+
320
+ def text(x, y, text, fontsize=None, color=None):
321
+ """添加文本
322
+
323
+ Args:
324
+ x: x 位置
325
+ y: y 位置
326
+ text: 文本内容
327
+ fontsize: 字体大小 (默认: None)
328
+ color: 颜色 (默认: None)
329
+ """
330
+ return _rsplotlib.text(x, y, text, fontsize, color)
331
+
332
+
333
+ def axhline(y=None, color=None, linestyle=None, linewidth=None):
334
+ """添加水平参考线
335
+
336
+ Args:
337
+ y: y 位置 (默认: None, 0)
338
+ color: 颜色 (默认: None)
339
+ linestyle: 线型 (默认: None)
340
+ linewidth: 线宽 (默认: None)
341
+ """
342
+ return _rsplotlib.axhline(y, color, linestyle, linewidth)
343
+
344
+
345
+ def axvline(x=None, color=None, linestyle=None, linewidth=None):
346
+ """添加垂直参考线
347
+
348
+ Args:
349
+ x: x 位置 (默认: None, 0)
350
+ color: 颜色 (默认: None)
351
+ linestyle: 线型 (默认: None)
352
+ linewidth: 线宽 (默认: None)
353
+ """
354
+ return _rsplotlib.axvline(x, color, linestyle, linewidth)
355
+
356
+
357
+ def hlines(y, xmin, xmax, color=None, linestyle=None, linewidth=None):
358
+ """绘制水平线段
359
+
360
+ Args:
361
+ y: y 位置
362
+ xmin: 线段起点 x
363
+ xmax: 线段终点 x
364
+ color: 颜色 (默认: None)
365
+ linestyle: 线型 (默认: None)
366
+ linewidth: 线宽 (默认: None)
367
+ """
368
+ return _rsplotlib.hlines(y, xmin, xmax, color, linestyle, linewidth)
369
+
370
+
371
+ def vlines(x, ymin, ymax, color=None, linestyle=None, linewidth=None):
372
+ """绘制垂直线段
373
+
374
+ Args:
375
+ x: x 位置
376
+ ymin: 线段起点 y
377
+ ymax: 线段终点 y
378
+ color: 颜色 (默认: None)
379
+ linestyle: 线型 (默认: None)
380
+ linewidth: 线宽 (默认: None)
381
+ """
382
+ return _rsplotlib.vlines(x, ymin, ymax, color, linestyle, linewidth)
383
+
384
+
385
+ # ==================== 配置函数 ====================
386
+
387
+ def xlabel(text):
388
+ """设置 x 轴标签
389
+
390
+ Args:
391
+ text: 标签文本
392
+ """
393
+ return _rsplotlib.xlabel(text)
394
+
395
+
396
+ def ylabel(text):
397
+ """设置 y 轴标签
398
+
399
+ Args:
400
+ text: 标签文本
401
+ """
402
+ return _rsplotlib.ylabel(text)
403
+
404
+
405
+ def title(text):
406
+ """设置图表标题
407
+
408
+ Args:
409
+ text: 标题文本
410
+ """
411
+ return _rsplotlib.title(text)
412
+
413
+
414
+ def grid(visible=True):
415
+ """显示/隐藏网格
416
+
417
+ Args:
418
+ visible: 是否显示网格 (默认: True)
419
+ """
420
+ return _rsplotlib.grid(visible)
421
+
422
+
423
+ def legend(loc='best'):
424
+ """显示图例
425
+
426
+ Args:
427
+ loc: 位置 (默认: 'best', 可选: 'upper right', 'upper left',
428
+ 'lower right', 'lower left', 'upper center')
429
+ """
430
+ return _rsplotlib.legend(loc)
431
+
432
+
433
+ def xlim(left, right):
434
+ """设置 x 轴范围
435
+
436
+ Args:
437
+ left: 左边界
438
+ right: 右边界
439
+ """
440
+ return _rsplotlib.xlim(left, right)
441
+
442
+
443
+ def ylim(bottom, top):
444
+ """设置 y 轴范围
445
+
446
+ Args:
447
+ bottom: 下边界
448
+ top: 上边界
449
+ """
450
+ return _rsplotlib.ylim(bottom, top)
451
+
452
+
453
+ def xticks(ticks=None, labels=None):
454
+ """设置 x 轴刻度
455
+
456
+ Args:
457
+ ticks: 刻度位置列表 (默认: None)
458
+ labels: 刻度标签列表 (默认: None)
459
+ """
460
+ return _rsplotlib.xticks(ticks, labels)
461
+
462
+
463
+ def yticks(ticks=None, labels=None):
464
+ """设置 y 轴刻度
465
+
466
+ Args:
467
+ ticks: 刻度位置列表 (默认: None)
468
+ labels: 刻度标签列表 (默认: None)
469
+ """
470
+ return _rsplotlib.yticks(ticks, labels)
471
+
472
+
473
+ # ==================== 子图与布局 ====================
474
+
475
+ def subplots(nrows=1, ncols=1):
476
+ """创建子图网格
477
+
478
+ Args:
479
+ nrows: 行数 (默认: 1)
480
+ ncols: 列数 (默认: 1)
481
+
482
+ Returns:
483
+ tuple: (Figure, axes_list)
484
+ """
485
+ return _rsplotlib.subplots(nrows, ncols)
486
+
487
+
488
+ def subplot(nrows, ncols, index):
489
+ """创建单个子图
490
+
491
+ Args:
492
+ nrows: 总行数
493
+ ncols: 总列数
494
+ index: 子图索引 (从1开始)
495
+
496
+ Returns:
497
+ Axes: 创建的子图
498
+ """
499
+ return _rsplotlib.subplot(nrows, ncols, index)
500
+
501
+
502
+ def tight_layout():
503
+ """自动调整子图布局"""
504
+ return _rsplotlib.tight_layout()
505
+
506
+
507
+ def set_size(width, height):
508
+ """设置图形尺寸
509
+
510
+ Args:
511
+ width: 宽度 (像素)
512
+ height: 高度 (像素)
513
+ """
514
+ return _rsplotlib.set_size(width, height)
515
+
516
+
517
+ def twinx():
518
+ """创建共享 x 轴的双 y 轴
519
+
520
+ Returns:
521
+ Axes: 新的 y 轴
522
+ """
523
+ return _rsplotlib.twinx()
524
+
525
+
526
+ def twiny():
527
+ """创建共享 y 轴的双 x 轴
528
+
529
+ Returns:
530
+ Axes: 新的 x 轴
531
+ """
532
+ return _rsplotlib.twiny()
533
+
534
+
535
+ # ==================== 图形控制 ====================
536
+
537
+ def figure(num=None, figsize=None, dpi=None):
538
+ """创建新图形(兼容 Matplotlib 风格的 `figsize` 和 `dpi` 参数)
539
+
540
+ Args:
541
+ num: 图形编号(兼容,未使用)
542
+ figsize: (width, height) 元组,单位为英寸
543
+ dpi: 分辨率
544
+
545
+ Returns:
546
+ Figure: 创建的图形对象
547
+ """
548
+ fig = _rsplotlib.figure()
549
+ # 默认 dpi 保持与 pyplot 一致的 100
550
+ d = dpi if dpi is not None else 100
551
+ # 调用底层设置方法(Rust 侧实现)
552
+ try:
553
+ fig.set_dpi(d)
554
+ except Exception:
555
+ pass
556
+ if figsize is not None:
557
+ try:
558
+ w_inch, h_inch = figsize
559
+ fig.set_size(round(w_inch * d), round(h_inch * d))
560
+ except Exception:
561
+ pass
562
+ return fig
563
+
564
+
565
+ def savefig(filename):
566
+ """保存图形
567
+
568
+ Args:
569
+ filename: 文件名 (支持 .svg 和 .png)
570
+ """
571
+ return _rsplotlib.savefig(filename)
572
+
573
+
574
+ def show():
575
+ """显示图形 (保存到默认位置)"""
576
+ return _rsplotlib.show()
577
+
578
+
579
+ def gca():
580
+ """获取当前 Axes
581
+
582
+ Returns:
583
+ Axes: 当前坐标轴
584
+ """
585
+ return _rsplotlib.gca()
586
+
587
+
588
+ def gcf():
589
+ """获取当前 Figure
590
+
591
+ Returns:
592
+ Figure: 当前图形对象
593
+ """
594
+ return _rsplotlib.gcf()
595
+
596
+
597
+ def cla():
598
+ """清空当前 Axes"""
599
+ return _rsplotlib.cla()
600
+
601
+
602
+ def clf():
603
+ """清空当前 Figure"""
604
+ return _rsplotlib.clf()
605
+
606
+
607
+ def close():
608
+ """关闭当前 Figure"""
609
+ return _rsplotlib.close()
610
+
611
+
612
+ # ==================== 对数坐标 ====================
613
+
614
+ def semilogx(x, y, label=None, color=None, linestyle=None, marker=None, linewidth=None):
615
+ """x 轴对数坐标折线图
616
+
617
+ Args:
618
+ x: x 轴数据
619
+ y: y 轴数据
620
+ label: 图例标签 (默认: None)
621
+ color: 颜色 (默认: None)
622
+ linestyle: 线型 (默认: None)
623
+ marker: 标记样式 (默认: None)
624
+ linewidth: 线宽 (默认: None)
625
+ """
626
+ return _rsplotlib.semilogx(_to_list(x), _to_list(y), label, color, linestyle, marker, linewidth)
627
+
628
+
629
+ def semilogy(x, y, label=None, color=None, linestyle=None, marker=None, linewidth=None):
630
+ """y 轴对数坐标折线图
631
+
632
+ Args:
633
+ x: x 轴数据
634
+ y: y 轴数据
635
+ label: 图例标签 (默认: None)
636
+ color: 颜色 (默认: None)
637
+ linestyle: 线型 (默认: None)
638
+ marker: 标记样式 (默认: None)
639
+ linewidth: 线宽 (默认: None)
640
+ """
641
+ return _rsplotlib.semilogy(_to_list(x), _to_list(y), label, color, linestyle, marker, linewidth)
642
+
643
+
644
+ def loglog(x, y, label=None, color=None, linestyle=None, marker=None, linewidth=None):
645
+ """双对数坐标折线图
646
+
647
+ Args:
648
+ x: x 轴数据
649
+ y: y 轴数据
650
+ label: 图例标签 (默认: None)
651
+ color: 颜色 (默认: None)
652
+ linestyle: 线型 (默认: None)
653
+ marker: 标记样式 (默认: None)
654
+ linewidth: 线宽 (默认: None)
655
+ """
656
+ return _rsplotlib.loglog(_to_list(x), _to_list(y), label, color, linestyle, marker, linewidth)
657
+
658
+
659
+ # ==================== 样式控制 ====================
660
+
661
+ def use(backend):
662
+ """选择后端 (兼容 matplotlib API)
663
+
664
+ Args:
665
+ backend: 后端名称 (如 'Agg', 'SVG')
666
+ """
667
+ _rsplotlib.use_(backend)
668
+
669
+
670
+ def xscale(scale):
671
+ """设置 x 轴缩放
672
+ Args:
673
+ scale: 缩放类型 ('linear', 'log', 'symlog', 'logit')
674
+ """
675
+ return _rsplotlib.xscale(scale)
676
+
677
+
678
+ def yscale(scale):
679
+ """设置 y 轴缩放
680
+ Args:
681
+ scale: 缩放类型 ('linear', 'log', 'symlog', 'logit')
682
+ """
683
+ return _rsplotlib.yscale(scale)
684
+
685
+
686
+ def margins(x_margin=None, y_margin=None):
687
+ """设置自动缩放的边距"""
688
+ return _rsplotlib.margins(x_margin, y_margin)
689
+
690
+
691
+ def box(on=None):
692
+ """设置坐标轴边框"""
693
+ return _rsplotlib.box_(on)
694
+
695
+
696
+ def minorticks_on():
697
+ """显示次要刻度"""
698
+ return _rsplotlib.minorticks_on()
699
+
700
+
701
+ def minorticks_off():
702
+ """隐藏次要刻度"""
703
+ return _rsplotlib.minorticks_off()
704
+
705
+
706
+ # ==================== 模块导出 ====================
707
+
708
+ __all__ = [
709
+ # 绘图函数
710
+ 'plot', 'scatter', 'bar', 'barh', 'hist', 'pie', 'boxplot',
711
+ 'fill_between', 'errorbar', 'stem', 'step', 'imshow',
712
+ # 辅助元素
713
+ 'text', 'axhline', 'axvline', 'hlines', 'vlines',
714
+ # 配置函数
715
+ 'xlabel', 'ylabel', 'title', 'grid', 'legend',
716
+ 'xlim', 'ylim', 'xticks', 'yticks',
717
+ 'xscale', 'yscale', 'margins', 'box', 'minorticks_on', 'minorticks_off',
718
+ # 子图与布局
719
+ 'subplots', 'subplot', 'tight_layout', 'set_size', 'twinx', 'twiny',
720
+ # 图形控制
721
+ 'figure', 'savefig', 'show', 'gca', 'cla', 'clf', 'close', 'gcf',
722
+ # 对数坐标
723
+ 'semilogx', 'semilogy', 'loglog',
724
+ # 样式
725
+ 'use',
726
+ # 类
727
+ 'Figure', 'Axes',
728
+ ]