
可视化
五道口纳什
wx公众号/B站:五道口纳什
展开
-
matplotlib —— step、bar、stem、errorbar、hist 图形的绘制
1. plt.step() 与 plt.bar()plt.bar(range(1, len(x)), x, alpha=.4, align=‘center’, label=‘individual’)plt.step(range(1, 14), np.cumsum(x), where=‘mid’, label=‘cumsum’)x = [ 4.8923083 2.46635032 1...原创 2018-10-23 19:07:12 · 5280 阅读 · 1 评论 -
自定义 matplotlib 设置
Customizing plots with style sheetsimport matplotlib as mpl查看配置文件所在的目录:mpl.get_configdir()1. 自定义 style在 mpl.get_configdir() 目录下,首先创建 stylelib 目录,接着创建 style 文件(~/.matplotlib/stylelib/myname.mplstyle)原创 2017-04-22 22:51:16 · 1229 阅读 · 0 评论 -
使用 Python 第三方库 daft 绘制 PGM 中的贝叶斯网络
daft 的官方文档请见 DAFT:BEAUTIFULLY RENDERED PROBABILISTIC GRAPHICAL MODELS.from matplotlib import rcrc("font", family="serif", size=12)rc("text", usetex=True)import daftpgm = daft.PGM([3.6, 2.7], origin=[原创 2017-05-03 11:29:07 · 3779 阅读 · 3 评论 -
使用 LaTeX 绘制 PGM(Probabilistic Graphical Models)中的贝叶斯网络(bayesian networks)
Software for drawing bayesian networks (graphical models)这里需要调用 latex 中的绘图库:TikZ and PGF。原创 2017-05-03 10:45:27 · 1916 阅读 · 0 评论 -
matlab 工具函数 —— axnote(在坐标轴上写文本内容)
function axnote(string)原创 2016-11-18 16:34:55 · 1224 阅读 · 0 评论 -
scipy 图像处理(scipy.misc、scipy.ndimage)、matplotlib 图像处理
from scipy.misc import imread / imsave / imshow imresize / imrotate / imfilterimread():返回的是 numpy.ndarray 也即 numpy 下的多维数组对象;原创 2017-02-21 18:54:33 · 31253 阅读 · 1 评论 -
matplotlib 可视化 —— cmap(colormap)
color example code: colormaps_reference.py — Matplotlib 2.0.0 documentation由其文档可知,在 colormap 类别上,有如下分类:perceptual uniform sequential colormaps:感知均匀的序列化 colormapsequential colormaps:序列化(连续化)色图 colorma原创 2017-03-27 16:08:33 · 88522 阅读 · 5 评论 -
可视化 —— 二维平面上的散列点在坐标轴方向上的移动
二维平面可以通过平面直角坐标系表示;二维平面上不同的散列点,也就是平面直角坐标系上的不同的点,其在坐标轴方向上的移动,分别在以下两个方向上的移动: 在 xx 轴方向上,(x1,y1)(x_1, y_1) ⇒ (x2,y1)(x_2,y_1)在 yy 轴方向上,(x1,y1)(x_1,y_1) ⇒ (x1,y2)(x_1, y_2)原创 2017-04-03 22:07:14 · 1591 阅读 · 0 评论 -
Matlab Tricks(二十五)—— plot 属性
marker: 边缘:’MarkerEdgeColor’, [],(RGB 配色)填充:’MarkerFaceColor’, [](RGB 配色)原创 2017-03-23 23:13:16 · 930 阅读 · 0 评论 -
matplotlib tricks(一)—— 多类别数据的 scatter(cmap)
多类别数据的 scatter(逐点散列),在 matplotlib 中的实现关键在于,color关键字的定义原创 2017-03-22 18:50:30 · 5288 阅读 · 0 评论 -
可视化 —— 在线图形绘制
1. 在线数学函数FooPlot | 线上数学函数绘图器原创 2017-03-13 21:59:43 · 9278 阅读 · 0 评论 -
数据可视化 —— 数据流图(Data Flow Diagram)
数据流图(Data Flow Diagram):简称 DFD,它从数据传递和加工角度,以图形方式来表达系统的逻辑功能、数据在系统内部的逻辑流向和逻辑变换过程,是结构化系统分析方法的主要表达工具及用于表示软件模型的一种图示方法。组成元素与基本构成:原创 2017-03-11 22:43:24 · 9415 阅读 · 0 评论 -
matplotlib 可视化 —— style sheets
Customizing plots with style sheets Matplotlib Style Gallery1. 常见 styleggplot:bmh:2. style 组合- plt.style.use(['dark_background', 'presentation'])原创 2017-04-22 22:45:49 · 1325 阅读 · 0 评论 -
matplotlib tricks(关闭坐标刻度、坐标轴不可见)
plt.gray():只有黑白两色,没有中间的渐进色1. 关闭坐标刻度(plt 与 AxesSubplot)pltplt.xticks([])plt.yticks([])关闭坐标轴:plt.axis('off')注意,类似的这些操作若想起作用,需要将其置于 plt.show() 之前,plt.imshow() 之后。对于 ax(matplotlib.axes....原创 2016-10-26 10:25:42 · 154249 阅读 · 5 评论 -
Python第三方库使用 —— PIL
因为语法的简洁,造就了功能的强大,因为开源,全世界的顶尖程序员们(各个行业的)辛勤地无私地也较为容易地为python贡献各式各样的第三方的库,再因为安装的便捷,普及也较为容易。如此种种,造就了python纷繁的世界。PIL:Python Image Library重要模块及其成员函数Image.fromarray()顾名思义,将二维数组转换为图像。from PIL import Imageimp原创 2015-12-10 10:43:45 · 11693 阅读 · 0 评论 -
matplotlib tricks —— 平滑方法
1. type显示关于命令类型的信息:An executable program like all those files we saw in /usr/bin.A command built into the shell itself. $ type cd$ type typeA shell function. An alias. $ type lsls is ali...原创 2016-05-24 12:22:55 · 1288 阅读 · 0 评论 -
matplotlib 操作子图(subplot,axes)
Matplotlib 中文用户指南 3.3 使用 GridSpec 自定义子图位置ax:matplotlib.axes._subplots.AxesSubplot,的基本操作 ax.set_xticks([]), ax_set_yticks([]):关闭坐标刻度ax.axis('off'):关闭坐标轴ax.set_title():设置标题1. subplotsfig, ax...原创 2018-04-26 21:45:50 · 17184 阅读 · 1 评论 -
卷积操作中的矩阵乘法(gemm)—— 为什么矩阵乘法是深度学习的核心所在
1. 全连接 kk 个输入;nn 个神经元; 每个神经元都会学到一组权值向量,以和输入进行内积运算;nn 个输出;2. 卷积卷积操作对于高维(多个平面)的输入,单个卷积核的深度应和输入的深度(depth)保持一致: 3 维卷积运算执行完毕,得一个 2 维的平面: 注,nn 个3维卷积核以得到 nn 个 feature maps;3. 卷积操作中的矩阵乘法按 [kernel_原创 2017-07-08 16:49:06 · 19326 阅读 · 2 评论 -
matplotlib 可视化 —— 定制 matplotlib
1. matplotlibrc 文件matplotlib使用matplotlibrc [matplotlib resource configurations] 配置文件来自定义各种属性,我们称之为 rc 配置或者 rc 参数。在 matplotlib 中你可以控制几乎所有的默认属性:视图窗口大小以及每英寸点数 [dpi];线条宽度,颜色和样式;坐标轴,坐标和网格属性;文本,字体等属性;ma原创 2016-08-26 11:51:26 · 2109 阅读 · 0 评论 -
在线算法交互、可视化与演示及应用(caffe 网络配置文件 .prototxt 的可视化)
1. 图像与视觉Image Kernels原创 2017-03-17 10:26:55 · 1410 阅读 · 0 评论 -
matlab 可视化 —— 高级 api(montage)、insertObjectAnnotation、insertMaker
1. montage:同时显示多个图像thumbnails = train_x(:, :, :, 1:100);thumbnails = imresize(thumbnails, [64, 64]);montage(thumbnails)原创 2017-05-06 12:07:51 · 4257 阅读 · 0 评论 -
家谱等人物关系图的绘制
1. 使用 smartdraw绘制图形展示请见:Genogram - What is a Genogram?下载地址:Top reasons SmartDraw is perfect for genograms:原创 2017-05-09 23:21:29 · 7783 阅读 · 0 评论 -
visio(2013)绘图工具的使用
1. 链接线 ⇒ 直线visio2010中如何使画出来的连接线为直线【设计面板】 ⇒ 在最右端将【链接线】设置为直线;2. 连接线交叉而不产生交叉桥(弯曲)visio2013画图时两条直线交叉 如何让它不弯曲【设计】⇒ 【连接线】(在设计选项卡的最右侧)⇒ 【显示跨线】 3. 连接点的添加、移动与删除 4. 插入大括号如下图所示:原创 2017-02-20 12:02:24 · 6275 阅读 · 0 评论 -
数据可视化(data visualization)—— seaborn
import seaborn as snssns.set(style=’dark’, palette=’muted’, color_codes=True, font_scale=1.5)原创 2016-01-03 11:24:36 · 3056 阅读 · 0 评论 -
matplotlib 等高线的绘制 —— plt.contour 与 plt.contourf
contour:轮廓,等高线。为等高线上注明等高线的含义:cs = plt.contour(x, y, z)plt.clabel(cs, inline=1, fontsize=10)plt.contourf 与 plt.contour 区别:f:filled,也即对等高线间的填充区域进行填充(使用不同的颜色);contourf:将不会再绘制等高线(显然不同的颜色分界就表示等高线本身),增加原创 2017-04-23 12:03:39 · 45140 阅读 · 6 评论 -
数据集可视化——tile("贴砖")
在大量的数据处理或者计算机视觉的文献和著作中,我们常见如下的数据集可视化(甚至对参数也可进行可视化,毕竟图像的本质是二维数组),通过文章末尾的代码我们发现只需对布局及间距的慎重设置,便可对大量丰富的图像以”地板贴砖(tiles on a floor)”的形式进行组织,也即可视化,展示数据或相关工作,可以起到十分直观的效果,下图即是对深度神经网络的权值矩阵进行的贴砖可视化: def normal原创 2015-12-10 16:26:41 · 4949 阅读 · 0 评论 -
matlab 图像的保存
gcf:获取当前显示图像的句柄;2. subplots保存某一个具体的 sub 子图;H = subplot(1,2,1);saveas(H,[pathname,filename],'jpg');原创 2017-03-02 12:59:25 · 2777 阅读 · 1 评论 -
什么图用什么工具画?
1. dendrogram(树状图)Python:from scipy.cluster import hierarchy原创 2016-11-17 19:34:17 · 1171 阅读 · 0 评论 -
matplotlib 可视化 —— 定制画布风格 Customizing plots with style sheets(plt.style)
Customizing plots with style sheets — Matplotlib 1.5.1 documentation1. 使用和显示其他画布风格>> import matplotlib.pyplot as plt>> plt.style.use('ggplot')>> plt.style.available[u'dark_background', u'bmh', u'grays原创 2016-08-26 08:33:29 · 4969 阅读 · 0 评论 -
matplotlib 可视化 —— matplotlib.patches
官方帮助文档 patches — Matplotlib 1.5.1 documentationpatches 下主要包含的常用图形类有:EclipseCircleWedge1. plt.gca().add_patch(**)注意,创建的图形对象不会直接在 figure 中显示,需要添加进 axis。import matplotlib import matplotlib.pyplot as原创 2016-08-25 15:44:41 · 5298 阅读 · 0 评论 -
绘图神器 —— Graphviz dot 语言介绍
(1)文字的属性:fontcolor,fontsize,(2)可选的形状有:box, polygon, ellipse, oval, circle, point, egg, triangle, plaintext, diamond, trapezium, parallelogram, house, pentagon, hexagon, septagon, octagon, doublecircle原创 2016-05-24 11:17:07 · 5683 阅读 · 0 评论 -
python matplotlib 方程的绘制
1. |x|+∣∣y∣∣=1\left|x\right|+\left|y\right|=1import numpy as npimport matplotlib.pyplot as pltx = np.arange(-1.1, 1.1, .01)y = np.arange(-1.1, 1.1, .01)x, y = np.meshgrid(x, y)f = np.abs(x) + np.abs原创 2016-06-18 18:13:36 · 7183 阅读 · 0 评论 -
matlab 可视化 —— axis
axis:轴,复数,axes Set axis limits and appearance,设置和控制轴的范围和外观;1. 设置坐标范围x = linspace(0,2*pi);y = sin(x);plot(x,y,'-o')axis([0, 2*pi, -1.5, 1.5]) % 注意参数是一个一维矩阵,原创 2016-06-09 12:00:43 · 2162 阅读 · 0 评论 -
ubuntu 下 Graphviz 的安装及神经网络的绘图
ubuntu 下 Graphviz 的安装sudo apt-get install graphviz神经网络的绘图touch nn.dotvim nn.dot编辑如下内容:digraph G { rankdir=LR splines=line nodesep=.05; node [label=""]; subgraph cluster_0 {原创 2016-05-21 09:51:07 · 5466 阅读 · 1 评论 -
绘图神器 —— Graphviz 绘制数据结构相关图形
复杂标签 digraph graphname{ /* 把节点的形状设置为 record,默认的是圆角矩形 */ node [shape = record]; root [label = "left|middle|right"]; left [label = "one|two"]; right [label = "hello\nworld|{b|{c|d|e原创 2016-05-24 10:47:18 · 8374 阅读 · 0 评论 -
绘图神器 —— Graphviz(一)
So in short, if you are a programmer, it is born for you.更多精彩范例请参考官网:Gallery | Graphviz - Graph Visualization SoftwareGraphviz (Graph Visualization Software) 是一个由AT&T实验室启动的开源工具包。DOT是一种十分简单的图形描述语言。无向图g原创 2016-05-24 10:10:45 · 1570 阅读 · 0 评论 -
可视化——matploblib 解决中文显示的问题
(1)导入相关包from matplotlib import mplimport matplotlib.pyplot as plt(2)指定字体mpl.rcParams['font.sans-serif'] = ['SimHei'];mpl.rcParams['axes.unicode_minus'] = False(3)使用中文plt.title(u'我是中文')原创 2016-04-12 12:06:47 · 7030 阅读 · 0 评论 -
matplotlib 可视化细节,丰富的可选参数
plt.xticks()第一个参数接受坐标,第二个参数接受,各坐标显示的文本,关键字参数,如 rotation,表示文本显示时旋转的角度,为了达到一种美观的效果。 import matplotlib.pyplot as pltimport numpy as npif __name__ == '__main__': data = [5840, 5704, 5754, 5431, 532原创 2016-02-20 08:52:34 · 7440 阅读 · 1 评论 -
matplotlib —— 注释及几何图形的绘制
可视化——matplotlib常用api(一)可视化——matploblib常见api(二)fig = plt.figure()ax = fig.add_subplot(111)t = np.arange(0, 5, .01)y = np.cos(2*np.pi*t)line, = ax.plot(t, y, lw=2)Annotating text import matplotlib.原创 2016-01-16 11:19:35 · 2568 阅读 · 0 评论 -
matplotlib —— fill between
可视化——matplotlib常用api(一) 基本命令 说明 plt.tight_layout() 针对fig, ax = plt.subplots(1, 3) plt.axis(‘equal’) 坐标轴刻度一致 plt.legend(loc=”) center left/center/center rightupper left/upper center/upper原创 2016-01-03 10:21:20 · 2668 阅读 · 1 评论