![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
matplotlib
X-giraffe
人不是产生灵感才去学习的,而在学习中才产生灵感。
展开
-
matplotlib.pyplot.colors figure
matplotlib.pyplot.colors 1. use single letterAliasColor‘b’blue‘g’green‘r’red‘c’cyan‘m’magenta‘y’yellow‘k’black‘w’white2. use an html hex stringFor a greater range of colors, you have two options. You can specify原创 2020-06-29 10:29:42 · 189 阅读 · 0 评论 -
Matplotlib Tutorials7 load CSV files
import matplotlib.pyplot as pltimport csvx = []y = []with open('example.txt','r') as csvfile: plots = csv.reader(csvfile,delimiter=',') for row in plots: x.append(int(row[0])) y.append(int(row[1]))plt.plot(x,y,label='loaded翻译 2020-06-13 18:50:31 · 121 阅读 · 0 评论 -
Matplotlib Tutorials 5 - Stack plots
Practice 1import matplotlib.pyplot as pltdays = [1,2,3,4,5]sleeping = [7,8,7,9,7]eating = [1,2,4,3,3]working = [7,8,9,10,7]playing = [5,7,8,10,3]plt.plot([],[],color = 'c',label = 'sleeping')plt.plot([],[],color = 'm',label = 'eating')plt.plot(翻译 2020-06-13 18:31:07 · 156 阅读 · 0 评论 -
Matplotlib Tutorals 4 - Scatter Plots
Practice 1import matplotlib.pyplot as pltx= [1,2.3,4,5,6,7]y= [10,11,12,13,15,14]plt.scatter(x,y,label='skitscat',color='k',s= 30,marker='*')plt.xlabel('x')plt.ylabel('y')plt.title('Interesting Graph\nCheck it out')plt.legend()plt.show()翻译 2020-06-13 18:22:45 · 122 阅读 · 0 评论 -
Matplotlib Tutorial 3 bar charts and histograms
Practice 1import matplotlib.pyplot as pltx = [1,2,3,4]y = [4,5,6,7]x2 = [4,2,7,3]y2 = [1,2,7,8]plt.bar(x,y,label= 'Bars1',color='c')plt.bar(x2,y2,label='Bars2',color='m')plt.xlabel('x')plt.ylabel('y')plt.title('Interesting Graph\nCheck it out翻译 2020-06-13 18:13:06 · 98 阅读 · 0 评论 -
Matplotlib Tutorial 6 pie Charts
import matplotlib.pyplot as pltsleeping = [7,8,6,7,11]eating = [2,2,3,4,2]working = [7,8,7,9,10]playing = [8,5,7,6,12]slices = [6,4,2,13]activitices = ['sleeping','eating','working','playing']cols = ['c','m','r','b']plt.pie(slices , labe翻译 2020-06-13 17:59:06 · 115 阅读 · 0 评论 -
解决 ModuleNotFoundError: No module named matplotlib.pyplot 问题
import numpy as npimport matplotlib.pyplot as pltplt.plot([1,2,3],[5,7,2])plt.show()翻译 2020-06-12 13:33:44 · 25489 阅读 · 12 评论