Mathematica数据处理(7)--散点图(下)
来源:互联网 发布:境外网络电视直播apk 编辑:程序博客网 时间:2024/06/06 15:52
今天我们来讲一下怎么画三维的散点图
先讲三个最基本函数
ListPlot3D
ListDensityPlot
ListContourPlot
和前面讲的一样,直接看三维的图比较直观,但是能理解的信息比较少,只能呈现一面的信息。
直接看下面的例子
data = Table[Sum[Sin[RandomReal[10, 2].{x, y}], {10 i}], {i, 3}, {x, 0, 5, .3}, {y, 0, 5, .3}];
产生一组数据
range = #[data[[1]]] & /@ {Min, Max}Row[{ ListPlot3D[data[[1]], ColorFunction -> "TemperatureMap", ImageSize -> 300, PlotLabel -> Style[ListPlot3D, 24]], ListDensityPlot[data[[1]], ColorFunction -> "TemperatureMap", ImageSize -> 300, PlotLabel -> Style[ListDensityPlot, 24]], ListContourPlot[data[[1]], ColorFunction -> "TemperatureMap", ImageSize -> 300, PlotLabel -> Style[ListContourPlot, 24]] }]
画图,找到其中最大值和最小值,后面的图例有用
得到下图
把图修饰的好看一点,加一下图例
pic1 = ListContourPlot[data[[1]], ColorFunction -> "TemperatureMap", ImageSize -> 300, PlotLabel -> Style[ListContourPlot, 24]];pic2 = BarLegend[{"TemperatureMap", range}, LegendLayout -> "Row", LegendMarkerSize -> 300];Column[{pic1, pic2}, Center]
得到下面的图
****************************************
这里我想讲一下ListPlot3D里面输入n×n时候的意思
知道的话可以直接跳过,其实就是其帮助文档的第一条
n×n的相当于定义了曲面的高度
a = {{0, 0, 0, 0}, {0, 10, 10, 0}, {0, 10, 10, 0}, {0, 0, 0, 0}};ListPlot3D[a, ImageSize -> Large, ColorFunction -> "TemperatureMap"]
这两行就相当于是其实相当于 在( 0 , 0 )的位置高度为0,即坐标( 0 , 0 , 0 ),在( 2 , 3 )的位置高度为10,即坐标( 2 , 3 , 10 )
画出来的图像是这样的
*****************************
下面继续
讲一下 点集对数图 点集双对数图
有的时候我们直接看数据发现不了规律,又是不妨转换一下坐标,就能发现其中的奥秘
我们来看一个下面的例子
动物的体重与大脑重量的关系
data = ExampleData[{"Statistics", "AnimalWeights"}]
获取数据
Grid[data, Frame -> All,Background -> {None, {{LightBlue, LightGreen}}}]
得到如下的数据
光看数据也看不出什么规律,我们把他在图上画一下,看一下呈现什么样子
{animal, brian, weight} = Transpose[data];chardata = Transpose@{brian, weight};ListPlot[chardata]
并不能看出什么规律,这时我们考虑转换坐标,转换成对数坐标
Row[{ ListLogPlot[chardata, ImageSize -> Medium], ListLogLogPlot[ Table[Tooltip[chardata[[i]], animal[[i]]], {i, 1, 28}], ImageSize -> Medium, Frame -> True, FrameLabel -> {"大脑平均重量", "平均体重(公斤)"}]
得到如下的图
可以看到在双对数图上,数据呈现 线性关系
2016/8/13
以上,所有
0 0
- Mathematica数据处理(7)--散点图(下)
- Mathematica数据处理(10)--美化(下)
- Mathematica数据处理(6)--散点图(上)
- Mathematica数据处理(2)
- Mathematica数据处理(3)
- Mathematica数据处理(4)
- Mathematica数据处理(5)--Plot
- Mathematica数据处理(11)--标签
- Mathematica数据处理(12)--图例
- Mathematica数据处理(1)--安斯库母四重奏
- Mathematica数据处理(8)--美化(上)
- Mathematica数据处理(9)--美化(中)
- Mathematica数据处理(13)--显示坐标
- mathematica散点图
- Mathematica
- Mathematica
- Linux下安装Mathematica 9的说明
- Pandas 数据处理(下)
- SIMCOM手册AT指令
- fiddler 手机 https 抓包
- unbuntu16.04_mongodb3.2.8 的傻瓜搭建流程
- 贪心______Keep On Movin( hdu 5744 2016多校第二场 )
- java异常处理之抛出异常
- Mathematica数据处理(7)--散点图(下)
- 第八天: 串口通信代码实战及uart stdio 移植
- 关于unicode汉字范围正则表达式的写法
- MyEclipse2016中部署Tomcat
- 使用老毛桃制作U盘启动盘
- HDU4284(状态压缩dp)
- tjut 2897
- 【设计模式】
- hashMap的内部实现原理