non rectangular density plots

4 次查看(过去 30 天)
Hi all,
I have to produce density plots like those obtained e.g. with imagesc, but on a triangular domain. That is: the "pixels" of my image lay on a triangular instead of a rectangular lattice. Of course I could use imagesc, filling only one half of a rectangular lattice (matrix), but this choice is not as aesthetically appealing and hides the symmetry of the problem. I get a rectangular triangle instead of an equilateral one.
What I'm doing now is plotting '.' markers at the sites of the triangular lattice, and then adding custom-made axes. The result is sort of ok, but I have some problems. For one the image is very "heavy" since I must individually plot a huge number of "pixels". Second, I cannot think of any means of changing the color code, like colormap(somemap) does. The color of each individual '.' marker is set at the moment of the plotting, and I have no idea as to how to have it respond to a colormap command.
I'd be really interested in any suggestion on ways of changing the colormap. I thought of using (exceedingly tiny) hexagonal patches instead of markers, but I guess that would make the image even bigger.
Thanks a lot for your help
Francesco

采纳的回答

Walter Roberson
Walter Roberson 2011-8-4
scatter() and pass a vector as the C parameter instead of passing an RGB matrix. The result will be colormap sensitive.
  1 个评论
pfb
pfb 2011-8-9
Thanks a lot Walter,
I do not know how I could miss the scatter function after so many years of matlab use.
As you suggest, scatter does exactly what I need. It has the same effect of the function I created *and* is colormap (and clim!) sensitive.
Thanks again

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Orange 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by