迈克在MATLAB图形 https://blogs.mathworks.com/graphics 迈克在MATLAB的图形和数据可视化工具。他写道这里关于计算机图形背后的概念和使用MATLAB图形创建有趣的和有用的可视化数据。 周五,2021年5月21日12:49:08 + 0000 en - us 每小时 1 https://wordpress.org/?v=4.9.15 计算机图形学几年 https://blogs.mathworks.com/graphics/2017/12/20/computer-graphics-years/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2017/12/20/computer-graphics-years/回应 2017年12月结婚,20 15:06:36 + 0000 mgarrity 未分类的 https://blogs.mathworks.com/graphics/?p=366

I loved the question that Steve recently asked on his blog about what your earliest computer experiences were. It brought back a lot of memories, but quickly turned into something that's too long for... read more >>

< div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

I loved the question that Steve recently asked on his blog about what your earliest computer experiences were. It brought back a lot of memories, but quickly turned into something that's too long for a comment on his blog. I thought it would be worth sharing here, because I was extremely lucky to be in the right place at the right time, and I saw the world of computing change suddenly and dramatically. If you're interested in the computer graphics (I assume you are if you're reading this blog), then it's a bit of history that you should probably know about. I first started using computers when I got to MIT in 1976. At that time, we were writing our code on IBM 029 keypunches. And we were preparing our data using

...read more >>

https://blogs.mathworks.com/graphics/2017/12/20/computer-graphics-years/feed/ 0
五个四面体 https://blogs.mathworks.com/graphics/2016/05/06/the-five-tetrahedra/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/05/06/the-five-tetrahedra/回应 2016年5月06日星期五17:36:06 + 0000 mgarrity 几何 https://blogs.mathworks.com/graphics/?p=499 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/five_tetrahedra_thumbnail.png " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p >十二面体是一个特别有趣的多面体。它充满了有趣的五倍对称。让我们看一看他们。首先我们需要的顶点。有一个有趣的…< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/05/06/the-five-tetrahedra/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

The dodecahedron is a particularly interesting polyhedron. It's full of interesting five-fold symmetries. Let's take a look at a couple of them.

First we'll need the vertices. There's an interesting pattern to them.

p = (1+sqrt(5))/2; q = 1/p; verts = [-1 -1 -1; ... -1 -1 1; ... 1 -1 1; ... 1 -1 -1; ... -q 0 -p; ... -p -q 0; ... 0 -p q; ... -p q 0; ... 0 -p -q; ... q 0 -p; ... -q 0 p; ... 0 p q; ... p -q 0; ... 0 p -q; ... p q 0; ... q 0 p; ... -1 1 1; ... -1 1 -1; ... 1 1 -1; ... 1 1 1];

We can draw them with scatter3.

grey = [.25 .25 .25]; scatter3(verts(:,1),verts(:,2),verts(:,3),'filled','MarkerFaceColor',grey) axis vis3d grid off box on

And we can draw the edges like so:

s = [1 1 1 2 2 2 3 3 3 4 4 4 5 5 6 7 8 8 10 11

...read more >>

https://blogs.mathworks.com/graphics/2016/05/06/the-five-tetrahedra/feed/ 0
FPLOT和朋友 https://blogs.mathworks.com/graphics/2016/04/20/fplot-and-friends/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/04/20/fplot-and-friends/回应 结婚,2016年4月20日14:57:33 + 0000 mgarrity 几何 https://blogs.mathworks.com/graphics/?p=475 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/fplot_thumbnail.png " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p >另一个新特性,我真的很喜欢在R2016a升级fplot功能和所有的fplot家族的新成员。fplot函数已经存在了很长一段时间。基本的想法是……< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/04/20/fplot-and-friends/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

Another new feature that I really like in R2016a is the upgraded fplot function and all of the new members of the fplot family.

The fplot function has been around for a long time. The basic idea is that you pass it a function which takes X coordinates as inputs and returns Y coordinates as outputs. Then fplot will use that function to draw a curve.

fplot(@(x) sin(x))

This is really useful for getting a "quick feel" for the shape of a function, or a family of functions.

fplot(@(x) besselj(x,1),[0 2*pi]) hold on fplot(@(x) besselj(x,2),[0 2*pi]) fplot(@(x) besselj(x,3),[0 2*pi]) fplot(@(x) besselj(x,4),[0 2*pi]) fplot(@(x) besselj(x,5),[0 2*pi]) hold off legend show

In addition to functions, if you have the Symbolic Math Toolbox, fplot can also accept

...read more >>

https://blogs.mathworks.com/graphics/2016/04/20/fplot-and-friends/feed/ 0
YYAxis https://blogs.mathworks.com/graphics/2016/04/04/yyaxis/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/04/04/yyaxis/回应 妈,04年4月2016 11:48:47 + 0000 mgarrity 图表 https://blogs.mathworks.com/graphics/?p=453 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/gas_travel_thumbnail.png " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p > R2016a我爱的特征之一是新的yyaxis函数。这是一个新的方法来创建块两个独立的Y,像老plotyy函数。让我们看看yyaxis……< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/04/04/yyaxis/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

One of the features I love in R2016a is the new yyaxis function. This is a new way to create plots which have two independent Y's, like the older plotyy function. Let's take a look at how yyaxis works, and why I think it's cool.

First we'll need some data. This type of chart is really useful for looking for relationships between data which has wildly different values. For example, I'm interested in the relationship between the price of gas and how much people drive. The Federal Reserve Bank of St. Louis maintains a great collection of historical records of all sorts of economic data like this. I can get the price of what they call "U.S. Gulf Coast, Regular" from this page, and load it into MATLAB using readtable.

tgas =

...read more >>

https://blogs.mathworks.com/graphics/2016/04/04/yyaxis/feed/ 0
像风一吹 https://blogs.mathworks.com/graphics/2016/03/14/as-the-wind-blows/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/03/14/as-the-wind-blows/回应 2016年3月14日,星期一,14:18:26 + 0000 mgarrity 图表 https://blogs.mathworks.com/graphics/?p=445 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/feature_image/buoy_example_thumbnail.png " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p >风BlowsNOAA维护大量的浮标,收集气象数据,和他们在他们的网站上发布的数据。有四个浮标在波士顿港。他们是……< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/03/14/as-the-wind-blows/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

As the Wind Blows

NOAA maintains a number of buoys that collect weather data, and they publish the data from them on their website.

There are four of these buoys just outside Boston harbor. They are the red squares on this map.

For example, the data for buoy 44013, which is the bottom one on that map, is available at this URL.

I downloaded the data for 2015, and I can read it into MATLAB like this:

t=readtable('44013c2015.txt','Format','%d%d%d%d%f%f%f%f%f%f','HeaderLines',2); t.Properties.VariableNames = {'YY','MM','DD','hh','mm','WDIR','WSPD','GDR','GST','GTIME'};

We can see that there are 52,460 rows in this table. That's one measurement every ten minutes for the entire year.

size(t) t(3805:3810,:) ans =

...read more >>

https://blogs.mathworks.com/graphics/2016/03/14/as-the-wind-blows/feed/ 0
签署了距离字段 https://blogs.mathworks.com/graphics/2016/03/07/signed-distance-fields/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/03/07/signed-distance-fields/回应 星期一,2016年3月07 16:22:26 + 0000 mgarrity 几何 https://blogs.mathworks.com/graphics/?p=437 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/feature_image/sdf_thumbnail.png " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p >最近我听到一个MATLAB用户试图吸引管沿着曲线使用这篇文章我写了一段时间回来。不幸的是她的曲线是更复杂的比我用的……< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/03/07/signed-distance-fields/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

Recently I heard from a MATLAB user who was trying to draw tubes along a curve using this blog post I wrote a while back. Unfortunately her curve was a bit more complex than the ones I used in that post. That approach of sweeping a 2D shape along a curve has a number of interesting edge cases that you'll encounter when your curves are complex.

In particular, her curve actually had a "fork" in it. This is a particularly tough case for the sweep approach. You basically need to sweep each of the two halves of the fork, and then slice off the parts of one sweep that are inside the other one. The math for this gets rather tricky.

Luckily there's another approach to this problem. This one is fairly compute intensive, but it's quite a bit simpler to implement. It's called signed distance fields. Let's take a look at how you would

...read more >>

https://blogs.mathworks.com/graphics/2016/03/07/signed-distance-fields/feed/ 0
在网格上 https://blogs.mathworks.com/graphics/2016/02/24/on-the-grid/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/02/24/on-the-grid/回应 结婚,2016年2月24日19:35:06 + 0000 mgarrity 几何 https://blogs.mathworks.com/graphics/?p=423 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/feature_image/grid_thumbnail.png " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p >一种类型的问题,我经常被问到如何使用各种可视化技术是有时被称为“散点数据”。这是单独的列表的数据测量....< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/02/24/on-the-grid/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

One type of question that I'm often asked is about how to use various visualization techniques with what is sometimes called "scatter data". This is data that is a list of individual measurements. These measurements often have locations associated with them, but that's not enough for many visualization techniques. These techniques also want grid information. This is information about how the measurements connect to each other. Let's take a look at a couple of ways in which we can get this grid information.

First we'll need some example data. Here I have 250 measurements. Each one has a 2D location and a value.

npts = 250; rng default x = 2*randn(npts,1); y = 2*randn(npts,1); v = sin(x) .* sin(y);

Scatter data, which is sometimes known as column data, gets its name from the fact that the scatter plot is the one visualization technique which is really designed for this type of

...read more >>

https://blogs.mathworks.com/graphics/2016/02/24/on-the-grid/feed/ 0
到Mucube https://blogs.mathworks.com/graphics/2016/02/08/into-the-mucube/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/02/08/into-the-mucube/回应 星期一,2016年2月08年15:03:53 + 0000 mgarrity 几何 https://blogs.mathworks.com/graphics/?p=415 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/feature_image/mucube_thumbnail.gif " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p >最后一次,当我谈论permutohedra,我们看到截断正八面体三维空间没有差距。与这个属性有很多形状,有可爱的老姓……< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/02/08/into-the-mucube/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

Last time, when I was talking about permutohedra, we saw how truncated octahedra fill 3D space with no gaps. There are a number of shapes with this property, and they have the lovely old family name convex uniform honeycomb. There's another interesting family that is related to the honeycombs. They're called apeirohedra or "infinite skew polyhedra". You make the apeirohedra by removing some of the faces of a honeycomb. This gives you an infinite set of faces that divide 3D space into two halves. These two halves pass through each other in very interesting and complicated ways.

Today I'm going to take a look at the simplest of these. It's called the mucube. It's basically an infinite stack of cubes with half of the faces removed. I can draw a tiny

...read more >>

https://blogs.mathworks.com/graphics/2016/02/08/into-the-mucube/feed/ 0
瓷砖六边形和其他Permutohedra https://blogs.mathworks.com/graphics/2016/01/29/tiling-hexagons-and-other-permutohedra/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/01/29/tiling-hexagons-and-other-permutohedra/回应 星期五,2016年1月29日13:37:29 + 0000 mgarrity 几何 https://blogs.mathworks.com/graphics/?p=403 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/feature_image/hexagonal_tiling_thumbnail.png " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p >在早些时候的帖子我们看瓷砖的四边形和五角大楼。六边形呢?我相信你已经看到了正六边形的瓷砖。他们受欢迎的地砖和游戏瓷砖。甚至……< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/01/29/tiling-hexagons-and-other-permutohedra/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

In earlier posts we've looked at tiling quadrilaterals and pentagons. So what about hexagons? I'm sure you've seen tilings of regular hexagons. They're popular in floor tiles and game tiles. Even bees know about this one. But there's one interesting feature of this tiling that you might not be familiar with. To see this feature, we need to start in a very different place.

We're going to start by making all of the permutations of the sequence [1 2 3]. As you probably know, for n items, there are n! permutations. So there are 6 different ways we can arrange these 3 numbers.

n = 3; np = factorial(n); pts = perms(1:n) pts = 3 2 1 3 1 2 2 3 1 2 1 3 1 2 3 1 3 2

Now we have an array with 6 rows and 3 columns. Since

...read more >>

https://blogs.mathworks.com/graphics/2016/01/29/tiling-hexagons-and-other-permutohedra/feed/ 0
多边形插值 https://blogs.mathworks.com/graphics/2016/01/14/polygon-interpolation/?s_tid=feedtopost https://blogs.mathworks.com/graphics/2016/01/14/polygon-interpolation/回应 星期四,2016年1月14日21:48:54 + 0000 mgarrity 呈现 https://blogs.mathworks.com/graphics/?p=361 < div class = "概览图像“> < img src = " https://blogs.mathworks.com/graphics/files/feature_image/polygon_interpolation_thumbnail.png " class = " img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image“alt = " / > < / div > < p >我最近在MATLAB回答一个问题的答案如何修补篡改的颜色数据。这是一个问题,我有很多,因为它是一个比你所想的要复杂一些。让我们仔细……< class = "阅读更多" href = " https://blogs.mathworks.com/graphics/2016/01/14/polygon-interpolation/ " >阅读更多> > < / > < / p > < div > < img风格= "显示:块;保证金:汽车;max-width: 500 px; " src = " https://upload.wikimedia.org/wikipedia/commons/6/62/Tektronix_4014.jpg " onError = " this.onerror =零;this.src = ' https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_11.jpg ';“/>

I recently answered a question on MATLAB Answers about how patch interpolates color data. This is a question I get a lot because it's a bit more complicated than you might expect. Let's take a close look at what it can and can't do.

First we'll need a patch with FaceColor='interp'. I'll start with this simple polygon and use the X coordinate as the color data.

ang = 0:pi/4.5:6; x = cos(ang); y = sin(ang); c = x; patch('XData',x,'YData',y,'CData',c,'FaceColor','interp') colorbar

That’s simple, isn’t it? We can work out what color each pixel should be by inserting the X coordinate into the colormap. But the Patch object is actually doing something a little subtler here. It’s actually creating a set of triangles which subdivide the interior of the polygon and then handing those off to the graphics system and asking it to figure out the color of each pixel in each of the triangles. The graphics system does that using linear interpolation. That works

...read more >>

https://blogs.mathworks.com/graphics/2016/01/14/polygon-interpolation/feed/ 0