首页 > 编程知识 正文

大数据可视化技术与应用实训答案,python数据可视化模块

时间:2023-05-03 14:27:27 阅读:55758 作者:849

实验六大数据可视化工具-处理(一)实验七大数据可视化工具-处理(二) )。

实验六大数据可视化工具—处理(一) ) ) )。

指路-流程概述和环境建设

实验目的

了解处理数据可视化的特点

掌握处理的简单操作

使用Processing获取简单的形状3358 www.Sina.com/http://www.Sina.com /

下载处理程序

https://processing.org/download/

)2)解冻压缩包

)3)图形环境

在Processing中进行开发涉及PDE和显示窗口。 size关键字以像素为单位定义显示窗口的大小,通常是processing APP应用程序中的第一步。

)4)定义背景和颜色

实验内容和主要步骤

)1)绘制像素点

使用set函数绘制单个像素点。 此函数接受显示窗口中的x、y坐标和作为颜色的第三个参数。 Processing也有一种称为color的类型,允许您为某些操作定义颜色。

)2)四边形1练习掌握Processing的安装和基本操作方法

(1)在处理中绘制形状

)2)随机绘制多个四边形

实验七大数据可视化工具—Processing (二)2熟悉Processing的绘制功能

掌握元胞自动机的概念和构建方法在Processing中绘制森林火灾模型3练习使用Processing绘制点、线、圆、椭圆、曲线等使用Processing复习如何绘制点、线、圆、椭圆、曲线等使用Processing进行点、线、圆

(1)通过procession描绘形状)2)随机描绘多个四边形

练习用Processing构建二维元胞自动机,并在此基础上建立森林火灾蔓延可视化模型

(1)代码int [ ] [ ] [ ] pix=new int [2] [ 400 ] [ 400 ]; int toDraw=0; int tree=0; int burningTree=1; int emptySite=2; int x_limit=400; int y_limit=400; color brown=color (80,50,10 ); //brown colorred=color (255,0,0 ); //red; 颜色绿色=颜色(0,255,0 );//绿色浮动升级=0.01; 浮动p burn=0.00006; 布尔表达式(浮动) if )随机(0,1 ) p )返回真; else返回假; }void setup () size ) ) 400,400 ); 帧速率(60;/* initializetoallemptysites */for (intx=0; x x_limit; x ) for(inty=0; y y_limit; { pix[toDraw][x][y]=emptySite; } }}void draw () { update ); for(intx=0; x x_limit; x ) for(inty=0; y y_limit; y () if ) pix[todraw][x][y]==tree ) stroke(green ); } else if (pix [ to draw ] [ x ] [ y ]==burning tree ) stroke(red ); }elsestroke(brown ); 点(x,y ); }todraw=(todraw==0)? 1 : 0; }void update () intx,y,dx,dy,cell,chg,burningTreeCount; int toCompute=(toDraw==0)? 1 : 0; for(x=1; x x_limit-1; x ) for(y=1; y y_limit-1; y({cell=pix[todraw][x][y]; //surveyareaforburningtreesburningtreecount=0; for(dx=-1; dx 2; dx () for ) dy=-1; dy 2; dy ) (if ) (dy==0) (dy==0) ) continue; else if (pix [ to draw ] [ xdx ] [ ydy ]==burning tree ] burningtreecount; }//determinenextstateif (单元格==burning tree ) chg=emptySite; elseif((cell==emptysite ) prob (pgrowth ) ) ) chg=tree; elseif((cell==tree ) prob (p burn ) ) ) chg=burningTree; elseif((cell==tree ) ) burningTreeCount 0) ) chg=burningTree; else chg=cell; pix[toCompute][x][y]=chg; () (2)运行

)3)模型演示

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。