程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

[data visualization application] python-r-double Y-axis visual rendering

編輯:Python

The main knowledge points are as follows :

  • Matplotlib-Axes.twinx() Method to add a secondary axis

  • ggplot2-sec.axis() Draw biaxial

Matplotlib-Axes.twinx() Method to add a secondary axis

Here we directly give the code for data preview and visual design , Some of the codes in the figure will be explained in detail , The data preview is as follows :

Custom color Dictionary year_color The construction code is as follows :

color = ("#51C1C8", "#E96279", "#44A2D6", "#536D84",
         "#51C1C8", "#E96279", "#44A2D6", "#536D84")
year = artist_01.index.to_list()
year_color = dict(zip(year,color))
year_color

The visualization code is as follows :

plt.style.use('fivethirtyeight')
fig,ax = plt.subplots(figsize=(8,4),dpi=200,fac

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved