Mathematica数据处理(10)--美化(下)
来源:互联网 发布:点windows键没反应 编辑:程序博客网 时间:2024/06/07 00:35
今天讲一下美化的最后一篇
其实还有两个函数没讲,分别是标签,和图例,我会另外讲的
那就直接开始讲吧
FrameLabel
GridLines
Plot[ Sin[x], {x, 0, 10}, Axes -> False, Frame -> {{True, False}, {True, False}}, FrameLabel -> {{y, None}, {x, None}}, RotateLabel -> False ]
注意:
(*RotateLabel使得标签不旋转*)
(*FrameLabel的也是{{left,right},{bottom,top}}*)
标签可以有四个位置可以放置
Manipulate[x, {x, 0, 1}, FrameLabel -> {{"left label", "right label"}, {"bottom label","top label"}}]
标签也不一定是文字,可以是任意的东西
data = Table[{i + RandomReal[{-3, 3}], i + RandomReal[{-4, 4}]}, {i, 1, 20}];xlbl = BoxWhiskerChart[ data[[All, 1]], BarOrigin -> Left, (*使得横着放*) Frame -> False, ImageSize -> 300 ];ListPlot[data, FrameLabel -> {{None, None}, {xlbl, None}}, Axes -> False, Frame -> True]
得到下面的图
下面讲一下GridLines
Plot[Sin[x], {x, 0, 4 Pi}, ImageSize -> 500, GridLines -> {{1, 2, 3}, Automatic} (*使用None就是不画*) ]
得到下面的图形
其中GridLines{{1,2,3},}表示在x=1,2,3的地方画线
系统默认的是网格线先画,有的时候会被隐藏,Method -> {"GridLinesInFront" -> True}可以使用这句话
(*在 某些情况下,网格线可能被隐藏*)(*这时就要使用 Method\[Rule]{"GridLinesInFront"\[Rule]True}*)GraphicsRow[{ DensityPlot[Sin[x] + Cos[y], {x, 0, 8}, {y, 0, 8}, GridLines -> Automatic], DensityPlot[Sin[x] + Cos[y], {x, 0, 8}, {y, 0, 8}, GridLines -> Automatic, GridLinesStyle -> Directive[Blue, Dashed, Thick], Method -> {"GridLinesInFront" -> True}] }, ImageSize -> 700]
得到下面的图
也可以对某一条线进行变化
(*也可以对某一特殊的直线进行变化*)DensityPlot[ Sin[x] + Cos[y], {x, 0, 8}, {y, 0, 8}, GridLines -> {{2, {4, Directive[Red, Dashed, Thickness[.01]]}, 6}, {{2, Red}, 4, 6}}, Method -> {"GridLinesInFront" -> True} ]
得到下面的图
看一个线在前面在后面的区别
data = Table[ Sum[Sin[RandomReal[2]*x] + i/4, {10 i}], {i, 1, 4}, {x, 0, 5, 0.5} ];GraphicsRow[ ListLinePlot[ data, PlotStyle -> Thread[{ColorData[13, "ColorRules"], Thickness[.008]}], Method -> {"GridLinesInFront" -> #}, GridLines -> Automatic, GridLinesStyle -> Directive[AbsoluteThickness[2], Opacity[.8], White], Background -> Lighter[Gray, .9], Axes -> None, Frame -> {{True, False}, {True, False}}] & /@ {True, False}, ImageSize -> 900 ](*线在前面 线在后面*)
得到下面的图
上面就大概把美化讲了一下
2016/8/16
以上,所有
0 0
- Mathematica数据处理(10)--美化(下)
- Mathematica数据处理(8)--美化(上)
- Mathematica数据处理(9)--美化(中)
- Mathematica数据处理(7)--散点图(下)
- Mathematica数据处理(2)
- Mathematica数据处理(3)
- Mathematica数据处理(4)
- Mathematica数据处理(5)--Plot
- Mathematica数据处理(11)--标签
- Mathematica数据处理(12)--图例
- Mathematica数据处理(1)--安斯库母四重奏
- Mathematica数据处理(6)--散点图(上)
- Mathematica数据处理(13)--显示坐标
- HTML TABLE 数据处理,美化
- Mathematica
- Mathematica
- Linux下安装Mathematica 9的说明
- Linux 下 美化字体
- poj 2531 Network Saboteur
- 常用的刷新技术(三)——PullToRefreshlibrary
- java程序异常处理
- js javascript 判断一个变量是否在一个数组中
- HDU Problem 5395 Gym Class 【拓扑排序+优先队列】
- Mathematica数据处理(10)--美化(下)
- 硬盘基础知识以及在Linux系统中的使用
- HDU 5833 高斯消元
- C#的第19节课
- 判断scrollview是否可以滚动
- chapter1、计算机技术概述
- hduoj 1166敌兵布阵(树状数组)
- Linux安装Maven本地私有库Sonatype Nexus
- POJ 1837Balance