
matplotlib
文章平均质量分 74
蓝鲸123
做更好的自己
展开
-
matplotlib将图横向拉长,自定义x轴
import matplotlib.pyplot as pltimport pandas as pdimport numpy as npimport matplotlib.ticker as tickerdef demo_plot(): x = range(100) N =len(x) y = range(100) plt.figure() plt.plot(x, y) plt.ylim((0, 1000)) plt.xticks(range(len(x)), x,原创 2020-09-26 21:16:48 · 12370 阅读 · 0 评论 -
python matplotlib 画注解图
import matplotlib.pyplot as plt#使用文本注解绘制树节点#定义文本框和箭头格式decisionNode=dict(boxstyle="sawtooth",fc="0.8")leafNode=dict(boxstyle="round4",fc="0.8")arrow_args=dict(arrowstyle="<-")def plotNode(no..原创 2018-05-16 14:56:55 · 1367 阅读 · 0 评论 -
Python数据可视化利器Matplotlib,如何绘制横向柱形图
Python绘图库Matplotlib中,横向柱形图主要通过barh函数绘制得到,该函数的使用方法与常见的纵向的柱形图绘制函数bar的用法相似。Axes.barh(y, width, height, left, align=’center’, **kwargs)或matplotlib.pyplot.barh(y, width, height, left, align=’center’,...原创 2018-06-06 22:03:36 · 28422 阅读 · 1 评论 -
matplotlib 画折线图
import matplotlib.pyplot as pltx1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]y1 = [30, 31, 31, 32, 33, 35, 35, 40, 47, 62, 99, 186, 480]x2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]y2 =...原创 2018-09-19 16:42:50 · 509 阅读 · 0 评论 -
matplotlib 画曲线图2
import matplotlib.pyplot as pltimport numpy as npdef get_file(acc_list,loss_list,filename): f1 = open(filename, 'r') for line in f1.readlines(): # print(line) line = line.st...原创 2019-01-08 23:03:12 · 1219 阅读 · 0 评论