当前位置:网站首页>Matplotlib common settings
Matplotlib common settings
2022-07-01 23:18:00 【Cold Lane (* _*)】
Line color and style
Common settings for charts
matplotlib.pyplot.plot Of color Parameter setting line color
color setting
General color
Other colors
Floating point RGB perhaps RGBA Tuples
Hexadecimal RGB perhaps RGBA character string
1-2 Between decimals as the gray value
X11/CSS4 Color name specified in
Xkcd Color name specified in
Tableau Colors in the palette
CN Color cycle of format
| b | Blue |
| g | green |
| r | Red |
| c | Turquoise |
| #FFFF00 | yellow |
| m | Magenta |
y | yellow |
| k | black |
w | white |
| 0.5 | Grayscale value string |

Tag settings
matplotlib.pyplot.plot Of linestyle Parameter setting color setting line style
Line style settings
1. Solid line '-'
2. Double line '--'
3. Point line '-.'
4. Dotted line ':'
Mark pattern
marker Parameters , Set marker style
| . | Dot the mark |
| , | Pixel marker |
| o | Filled circle mark |
| v | Inverted triangle |
| ^ | Upper triangle mark |
| > | Right triangle |
| < | Left triangle |
| 1 | Lower flower triangle mark |
| 2 | Flower triangle mark |
| 3 | Left flower triangle mark |
| 4 | Right flower triangle mark |
| s | Solid square mark |
| p | Black Pentagon mark |
| * | Star sign |

Look at the usage of tags

Layout settings
Set up the canvas
Grammar format
matpoltlib.pyplot.figure(num=None,figsize=None,dpi=None,facecolor=None,edgecolor=None,frameon=True)Parameter description
1.num: Image number or name , Numbers are numbers , The string is the name , You can activate different canvases through this parameter
2.figsize: Specify the width and height of the canvas , In inches
3.dpi: Specifies the resolution of the drawing object , That is, how many pixels per inch , The default value is 80. The bigger the pixels , The bigger the canvas
4.facecolor: The background color
5.edgeolor: Border color
6.frameon: Show border or not , The default value is True, bound box , If False, No borders are drawn
The canvas is the background .
Set the coordinate axis and grid
Set axis
Set the axis title
xlabel Function settings x Axis title ,ylabel Function settings y Axis title
Solve the problem of Chinese garbled code
plt.rcParame['font.sans-serif']=['SimHei']Set axis scale
xticks Function settings x Axis scale ,yticks Function settings y Axis scale
Set the axis range
xlim Function settings x Axis coordinate axis range ,ylim Function settings y Axis coordinate axis range
Set the network cable
grid() Function to set gridlines



Text label _ title _ legend
Add text label
matplotlib.pyplot.text(x,y,s,**kwargs)| fontsize | font size |
| ha | Horizontal alignment |
| va | Vertical alignment |
Set the title and legend
matplotlib.pyplot.title()
matplotlib.pyplot.legend()| best | The adaptive |
| lower right | Lower right |
| center left | Left middle |
| center | Right center |
| upper right | upper right |
| lower left | lower left |
| center right | Right middle |
| lower center | Lower middle |
| upper left | upper left |
| right | On the right side |
| upper center | Upper middle |



Text notes and axis tick marks
Add notes
matplotlib.pyplot.annotate(s,xy,xytext,xycoords,arrowprops)Adjust the gap between the chart and the canvas edge
matplotlib.pyplot.subplots_adjust(left,right,top,bottom)The scale line of the coordinate axis
matplotlib.pyplot.tick_params(bottom,left,right,top)
matplotlib.pyplot.rcParams('xtick.direction')='in'
matplotlib.pyplot.rcParams('ytick.direction')='in'边栏推荐
- 2022年R1快开门式压力容器操作考题及答案
- 云信小课堂 | IM及音视频中常见的认知误区
- CKS CKA CKAD 将终端更改为远程桌面
- SWT/ANR问题--SWT 导致 low memory killer(LMK)
- 内存泄露和内存溢出的区别是什么?
- Airserver latest win64 bit personal screen projection software
- 实在RPA:银行数字化,业务流程自动化“一小步”,贷款审核效率“一大步”
- flutter Unable to load asset: assets/images/888.png
- 有些能力,是工作中学不来的,看看这篇超过90%同行
- 2022安全员-C证考试题模拟考试题库及模拟考试
猜你喜欢

使用3DMax制作一个象棋棋子

2022 R1 fast opening pressure vessel operation test questions and answers

会声会影2022智能、快速、简单的视频剪辑软件

Istio, ebpf and rsocket Broker: in depth study of service grid

【小程序】通过scroll-view组件实现左右【滑动】列表

建模和影视后期有什么关联?

2022安全员-C证考试题模拟考试题库及模拟考试

2022年危险化学品经营单位安全管理人员考试题及在线模拟考试

Cisco -- an external tool for WAN's concept examination

Glass mosaic
随机推荐
Groups and ranges of regular series
2022 safety officer-c certificate examination question simulation examination question bank and simulation examination
微服务服务稳定性治理
Use of locust
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received
认识线程
Yoga27 multidimensional all-in-one computer with excellent appearance and high-end configuration
Rank ranking with MySQL 5.7
Which securities company is better and which is safer to open a securities account
win 10 mstsc连接 RemoteApp
Redis~02 cache: how to ensure data consistency in MySQL and redis when updating data?
flutter Unable to load asset: assets/images/888. png
"35 years old, the boss of the company, with a monthly salary of 20000, give away takeout": the times abandoned you, not even saying goodbye
MySQL binlog cleanup
Redis~02 缓存:更新数据时如何保证MySQL和Redis中的数据一致性?
[micro service sentinel] @sentinelresource details
MySQL -- convert rownum in Oracle to MySQL
Istio, ebpf and rsocket Broker: in depth study of service grid
每日三题 6.28
2022年起重机司机(限桥式起重机)考试试题及模拟考试