剪切坐标轴
来源:互联网 发布:怎么在淘宝买百度云 编辑:程序博客网 时间:2024/04/29 16:35
一般的科学论文用图片可以用SciDraw在Mathematica上实现,有些特殊的功能,比如剪断坐标轴的,可以用下面方式:
ClearAll[snip]snipCurve = Graphics[{BezierCurve[{{0, -(1/2)}, {1/3, 0}, {-1/3, 0}, {0, 1/2}}]}];snip[pos_?NumberQ, primitive_Graphics: snipCurve] := snip[{pos}, primitive];snip[pos_List, primitive_Graphics: snipCurve] := Arrowheads[{Automatic, #, primitive} & /@ pos];snip[pos_List, primitives_List] := Arrowheads[ Flatten /@ MapThread[{Automatic, ##} &, {pos, primitives}]];snip[sizes_List, pos_List, primitives_List] := Arrowheads[Flatten /@ Transpose[{sizes, pos, primitives}]]data1 = {{1, 1.1}, {2, 1.5}, {3, 0.9}, {4, 2.3}, {5, 1.1}};data2 = {{1, 1001.1}, {2, 1001.5}, {3, 1000.9}, {4, 1002.3}, {5, 1001.1}};data3 = {{1, 8001.1}, {2, 8001.5}, {3, 8000.9}, {4, 8002.3}, {5, 8001.1}};getMaxPadding[p_List] := Map[Max, (BorderDimensions@ Image[Show[#, LabelStyle -> White, Background -> White]] & /@ p)~Flatten~{{3}, {2}}, {2}] + 1p1 = ListPlot[data1, PlotRange -> All, Joined -> True, Mesh -> Full, PlotStyle -> Red, AxesStyle -> {{Arrowheads[.035(*here*), .035], Directive[Black, 12]}, {snip[1], Directive[Black, 12]}}, PlotRangePadding -> .2, ImagePadding -> {{50, 5}, {15, 5}}, AspectRatio -> 1/3];p2 = ListPlot[data2, PlotRange -> All, Joined -> True, Mesh -> Full, PlotStyle -> Blue, Axes -> {False, True}, AxesStyle -> {{None}, {snip[{0, 1}], Directive[Black, 12]}}, PlotRangePadding -> .2, ImagePadding -> {{50, 15}, {3, 5}}, AspectRatio -> 1/3];p3 = ListPlot[data3, PlotRange -> All, Joined -> True, Mesh -> Full, PlotStyle -> Magenta, Axes -> {False, True}, AxesStyle -> {{None}, {snip[{Automatic, .035}, {0, 1}, {snipCurve, {}}], Directive[Black, 12]}}, PlotRangePadding -> .2, ImagePadding -> {{50, 15}, {3, 5}}, AspectRatio -> 1/3];output = Column[{p3, p2, p1} /. Graphics[x__] :> Graphics[x, ImagePadding -> getMaxPadding[{p1, p2, p3}], ImageSize -> 600]]Export["testOutputSnipAxis.png", output]
0 0
- 剪切坐标轴
- 坐标轴
- 坐标轴
- 剪切
- 剪切
- 复合坐标轴
- XPath 坐标轴
- openGL 坐标轴
- 绘制坐标轴
- ggplot_坐标轴
- d3坐标轴
- 双坐标轴
- D3 坐标轴
- 设置坐标轴
- 剪切基础
- 图片剪切
- 图片剪切
- sprite剪切
- 排序算法
- iOS KVC
- Linux 如何禁止用户登录
- spring学习——常用注解
- PyQt5-Beginner-tutorial-part 3
- 剪切坐标轴
- java学习中一些基础知识
- Android API Guides---Session Initiation Protocol
- 机器学习实战之PCA
- Maven项目启动时如何查找默认的显示页面
- 手把手教你搭建SpringMVC——最小化配置
- new element面试心得与体会
- nyoj488 素数环
- 欢迎使用CSDN-markdown编辑器