Limit number of colormap points in a trisurf

I am trying to tell a trisurf only to use t diffrent colors in order highlight passages. My code looks like this:<br>
tri=delaunay(x,y);
plot(x,y,'.');
size(tri);
ts=trisurf(tri,x,y,z,c);
lighting none
shading interp
map=colormap(jet(t));
unfortunatly I am only able to limit the number of colors used in the colorbar, but not the trisurf itself.I know that i can change the shading to flat, but I need a slight interpolation of the color inbetween the points, but the colors used inbetween should still be limited by colormap;

1 件のコメント

Image Analyst
Image Analyst 2014 年 9 月 5 日
I tried to try it but you didn't supply x and y so it bombed and I gave up. Make it easy for us to help you. What is t? It can be as large as 256. You might also look at caxis(). More help can be given if you give us code that can run.

サインインしてコメントする。

 採用された回答

Mike Garrity
Mike Garrity 2014 年 9 月 5 日

0 投票

Check your renderer.
get(gcf,'Renderer')
If it's OpenGL, then you've probably hit a bug in how interpolated color works in the OpenGL renderer.
If the size of x & y is large, then the system will choose OpenGL by default, but you can override that like so:
set(gcf,'Renderer','zbuffer')

1 件のコメント

betlor5
betlor5 2014 年 9 月 5 日
Thanks, adding the render option solved the problem.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeColor and Styling についてさらに検索

質問済み:

2014 年 9 月 5 日

コメント済み:

2014 年 9 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by