wolfram mathemat ListPlot 命令画图怎么给python画图坐标轴范围添加标签

Mathematica数据处理(5)--Plot
今天这一篇文章,我们来讲一下画图
我们会分为2D和3D的来分别讲述
首先让我们看一下在Mathematica中画图的函数有多少
fun = Names["*Plot"];
Grid[Partition[fun, 3, 1],Background -& {None, {{LightBlue, LightRed}}}, Frame -& All]
来看看,这是结果
很明显,我这里要讲完这么多是不可能的,所以我们就挑几个讲一下
首先讲2D的
最重要的当然是Plot,相信大家都已经会用了,我就放一个简单的例子
Plot[2*E^(2*x), {x, 0, 4}, PlotLabel -& Style[Plot, 24],ImageSize -& Large]
得到下面的图
下面讲一下 对数图,对数线性图,双对数图
我们以对数图为例讲一下
对数图其实就是将y轴的坐标做了Log的运算。
例如上图,在对数图下面就是一条直线,这么做是为了更好发现数据之间的关系的
下面举个例子
GraphicsRow[{
LogPlot[2*E^(2*x), {x, 0, 4}, PlotLabel -& Style[LogPlot, 24],
ImageSize -& Medium],
(*以y为对数坐标画图,相当于y轴坐标做了一个Log的变换,注意此时y轴为对数刻度,只是坐标变了,数字并没有变化*)
LogLinearPlot[2*E^(2*x), {x, 1, 4},
PlotLabel -& Style[LogLinearPlot, 24], ImageSize -& Medium],
(*x是对数*)
LogLogPlot[2*E^(2*x), {x, 1, 4}, PlotLabel -& Style[LogLogPlot, 24],
ImageSize -& Medium]
(*x,y都是对数*)
得到如下的图
当然,还有极坐标画图
PolarPlot[t, {t, 0, 20}]
得到如下的图
下面讲一下3D的作图
Plot3D是可以直接画出3D的图像的
f[x_, y_] := Sin[x^2 + y^2]/(x^2 + y^2 + 1);
Plot3D[f[x, y], {x, -4, 4}, {y, -4, 4},PlotLabel -& Style[Plot3D, 24], PlotTheme -& "Classic"]
有的时候,对于三维的图,虽说很直观,但是一些数据并不容易观察出,此时我们就需要借助
密度图 和 绘制等高线
GraphicsRow[{
DensityPlot[f[x, y], {x, -4, 4}, {y, -4, 4},
PlotLabel -& Style[DensityPlot, 24], ImageSize -& Medium,
ColorFunction -& "CMYKColors"],
ContourPlot[f[x, y], {x, -4, 4}, {y, -4, 4},
PlotLabel -& Style[ContourPlot, 24], ImageSize -& Medium,
ColorFunction -& "CMYKColors"]
(*一般来说,颜色越浅,对应的函数值就越大*)
(*等高线图就是把密度图分成若干份*)
得到如下的图
我们还可以把图画的更好一些,加一些注释
DensityPlot[f[x, y], {x, -4, 4}, {y, -4, 4},
PlotLabel -& Style[DensityPlot, 24], ImageSize -& Medium,
ColorFunction -& "CMYKColors"],
BarLegend[{"CMYKColors", range}, LegendLayout -& "Row",
LegendMarkerSize -& 400]
}, Center]
得到下面的图
可以看到黑色的地方函数值是最大的,和我们在3D图上看到的是一样的
最后我们看三种 球 的画法
GraphicsRow[{
ParametricPlot3D[{Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]}, {v, 0,
2 Pi}, {u, 0, 2 Pi}, PlotLabel -& Style["三位参数图", 24],
ImageSize -& Medium, ColorFunction -& ColorData["TemperatureMap"]],
SphericalPlot3D[1, {\[Theta], 0, 2 Pi}, {\[Phi], 0, 2 Pi},
PlotLabel -& Style["三维球面图", 24], ImageSize -& Medium,
ColorFunction -& ColorData["TemperatureMap"]],
RevolutionPlot3D[{Cos[t], Sin[t]}, {t, -Pi/2, Pi/2},
PlotLabel -& Style["三维旋转图", 24], ImageSize -& Large,
ColorFunction -& ColorData["TemperatureMap"]]
}, ImageSize -& Full]
得到下面的图
上面就是关于Mathematica画图的一些知识
以上,所有
没有更多推荐了,
不良信息举报
举报内容:
Mathematica数据处理(5)--Plot
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!豆丁微信公众号
君,已阅读到文档的结尾了呢~~
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
mathematica-学习使用超级教程
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='http://www.docin.com/DocinViewer-.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口Enterprise Solutions
Mobile Apps
Engineering, R&D
Finance, Statistics & Business Analysis
Web & Software
Need Help?
Premium Support
Work with Us
Initiatives
Message Boards
Hello all,I've been trying to create a 3 D plot from my data. I have my X,Y, Z matrices, where Z = f(X,Y). I have my matrices in excel, which I've imported to Mathematica.A little bit of background here - I've not used Mathematica before. But fairly comfortable with Matlab. I'm trying to use Mathematica because it lets me create plots where I can create 3D models with tubes as opposed to surfaces on Matlab. My final goal is to create a 3D surface and export it as an STL file so that it can be printed using a 3D printer.Here's an image of what I'm trying to make:I'd appreciate it if someone can help me with this.Thanks.
POSTED BY:
4 years ago
Generally it is always a good idea to provide working code so that others have a starting point.All this is very easy to do in Mathematica. No need to use Excel either, because I see that you build analytic surfaces that can be sampled in Mathematica too. First I recommend reading
who did a lot of work on the subject and .A rather quick summary for you about specifically your problem. Here is the code:&f[u_, v_] := {u, v, u^2 - v^2};&scale = 40;&radius = 0.75;&gridSteps = 10;&curvesU = Table[scale*f[u, i], {i, -1, 1, 2/gridSteps}];&curvesV = Table[scale*f[j, v], {j, -1, 1, 2/gridSteps}];&tubesU = ParametricPlot3D[curvesU, {u, -1, 1}, && &PlotStyle -& Tube[radius], PlotRange -& All];&tubesV = ParametricPlot3D[curvesV, {v, -1, 1}, & &PlotStyle -& Tube[radius], PlotRange -& All];corners = & Graphics3D[& &Table[Sphere[scale f[i, j], radius], {i, -1, 1, 2}, {j, -1, 1, 2}]];output = Show[tubesU, tubesV, corners]Export["MathematicaParametricSurface.stl", output]Here is how the resulting STL file is viewed in an independent STL viewing program - for example
which is free:And here is final 3D printed :Now sometimes you will wish to plot surfaces as they are, not as meshes. Here is a simple example.model = RevolutionPlot3D[{Sin[t] + Sin[5 t]/10, & &Cos[t] + Cos[5 t]/10}, {t, 0, Pi}, & RegionFunction -& (Sin[5 (#4 + #5)] & 0 &), Mesh -& None, & BoundaryStyle -& Black, PlotStyle -& Thickness[.1]]Export["model.stl", model];Import[%]Now further very useful links:
POSTED BY:
4 years ago
Dear Vitaliy,I have already looked into the paper by Segermen, actually. He uses a parametric funtion to get his mesh. What I'm trying to do is generate a mesh plot from my data. I don't have a functional form to it. That is something I'm unable to do, which is also why I couldn't supply any code to this query. I would appreciate it if you can help me in this direction.Thanks.
POSTED BY:
4 years ago
So the plot you provided is not built from your data? Also what kind of data you have? Did you try to visualize them in Mathematica? - we have a lot of functions for that - ListPlot3D and similar. Without more infirmation it is very hard to move ahead.
POSTED BY:
4 years ago
That's correct. The plot I provided was in fact based of Segermen's code. I just used it as an example to show what I want to do with my data. I'm sorry about the confusion. I should have been more clear earlier.I have matrices of X,Y and Z where Z=f(X,Y). I tried visualizing it in Mathematica. But I'm only able to do it as a solid surface. Not as a mesh plot.So, what I'm trying to do is import my data into Mathematica and create a mesh plot of it and if possible create tubes around the each line so that it can be exported as an STL file and printed with a 3D printer.
POSTED BY:
4 years ago
Let's make up some data points in simple matrix form and plot them with ListPlot3D in such a way that only mesh is visible.data = Table[i Sin[j^2 + i], {i, 0, Pi, .3}, {j, 0, Pi, .3}];p = ListPlot3D[data, Mesh -& 7, PlotStyle -& None, InterpolationOrder -& 2]The code below will extract info about mesh and replace it with printable 3D objects - spheres and cylinders.&pts = p[[1, 1]]; (* gets all points of interpolation *)&&rad = .1; (* radius of tubes and spheres *)&fre = 5; (* sampling rate of interpolated points *)&obj =& Graphics3D[&& {&& &(* tube will make cylinders in STL file *)&& &p[[1]] /. Line[l_] :& {White, Tube[l[[1 ;; -1 ;; fre]], rad]},& && &(* sphere to close the breaks between the cylinders *)& &GraphicsComplex[pts, Sphere[Flatten[Cases[p, Line[l_] :& l[[1 ;; -1 ;; fre]], Infinity]] // Union, rad]]& &},& BoxRatios -& Automatic];Export["test.stl", obj]
POSTED BY:
4 years ago
I just tapped on the 3D plot and saved as STL file to print on 3d. Nice result of dodecahedron.
POSTED BY:
3 years ago
Group Abstract
For Customers
Public Resources
Enable JavaScript to interact with content and submit forms on Wolfram websites.用 ListPointPlot3D 画的散点图,有没有什么办法进行点的标注?_mathematica吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:13,597贴子:
用 ListPointPlot3D 画的散点图,有没有什么办法进行点的标注?收藏
我就是想达到下面这张示例图的效果。(图中的 蓝色的字符和蓝色的线是我用画图软件加上去的)我想知道这样的任务能不能完成:1 给每个点上加上标签,标签的内容可能是任意的,是可以通过传递点坐标到一个函数里去生成出来的。标签的字体大小不随着视图缩放,无论视图放大缩小,标签文字都同样大。标签的方向不随着视图旋转,无论视图如何旋转,标签都是正的。2 每个点的圆心到坐标系原点画一条最细的线。
mathematica大促销,买的越多送的越多;免费现场培训,mathematica高清视频教程,共28个视频,1096分钟,免费试看.
用Graphics3D啊
dset = {{8, 2, 1}, {0, 8, 6}, {6, 3, 9}, {0, 9, 9}};Graphics3D[{PointSize@Large, Tooltip[Point[#], #] & /@ dset,
Text[#, # - 1] & /@ dset, Line[{#, {0, 0, 0}}] & /@ dset},
Axes -& True, AxesLabel -& {x, y, z}]颜色就没改了..
鼠标移到点上还会出现坐标..
也可以试试下面这样子dset = {{8, 2, 1}, {0, 8, 8}, {6, 3, 9}, {0, 9, 9}};Show[ListPointPlot3D[dset, AspectRatio -& 1, BoxRatios -& {1, 1, 1},
PlotRange -& {{0, 8}, {0, 9}, {0, 9}},
ColorFunction -& Function[{x, y, z}, RGBColor[x, y, z]],
PlotStyle -& {PointSize[0.05]}, AxesLabel -& {"X", "Y", "Z"}],
Graphics3D[{Blue, Line[{{0, 0, 0}, #}] & /@ dset}],
Graphics3D[{Null,
Text[Style["(" && ToString[#1] && "," && ToString[#2] && "," &&
ToString[#3] && ")" & @@ dset[[#]], Blue, 18],
dset[[#]] - {0, 0, 0.5}]} & /@ Range[4]]]
收藏起来!学习学习!
登录百度帐号Mathematica教程ppt下载_爱问共享资料
Mathematica教程.ppt
Mathematica教程.ppt
Mathematica教程.ppt
简介:本文档为《Mathematica教程ppt》,可适用于高等教育领域,主题内容包含Mathematica教程Mathematica教程第章Mathematica概述第章Mathematica的基本量第章Mathematica的基本符等。
侵权或盗版
*若权利人发现爱问平台上用户上传内容侵犯了其作品的信息网络传播权等合法权益时,请按照平台要求书面通知爱问!
赌博犯罪类
67人已下载
在此可输入您对该资料的评论~
添加成功至
资料评价:

我要回帖

更多关于 matlab画图坐标轴标注 的文章

 

随机推荐