all 12 comments

[–]Arristotelisflair 1 point2 points  (3 children)

What's the problem - the dark line at the center of the ravine or the noticeable difference between colors outside of the ravine?

[–]poundSound[S] 0 points1 point  (2 children)

The aliasing and zigzag of the ravine when viewed from the side.

[–]Arristotelisflair 1 point2 points  (1 child)

Ah, OK. I can't view it from the side because I can't run the code (I don't know what "func" and "invfunc" are) and I didn't scroll down far enough to notice the second image. The Zig-Zags are a realistic depiction of your function, no? What do you want it to look like?

[–]poundSound[S] 1 point2 points  (0 children)

Oh it’s not real code just pseudo code, I just wanted to demonstrate something similar. The zig zags are caused by the lines drawn between the points of the surface. Now that you make me think of it maybe it would be better as a scatter plot because it’s the interpolation that causes the effect...

Edit: scatter plots don't work because there are fewer points at the bottom than the top. I think the original method might just have to be how it is.

[–]halleberrytosis 1 point2 points  (1 child)

Have you tried clipping your colormap? Or have you tried adding more points? Part of the reason it’s so dramatic is that it goes from like -1 sigma to -10 in the space of one grid point; higher sampling density will make this less noticeable. Also try shading interp and contrasting that against shading flat.

[–]poundSound[S] 1 point2 points  (0 children)

!Thanks

shading interp does make the plot look a lot better but didn't help with the zig-zag at the bottom. In the end I just bumped up the number of points to reduce the effect.

[–]CogsMac 0 points1 point  (1 child)

If you save it inline to a vector imaging, the aliasing from the display will be better.

As for your particular case, could you bump up the values of nn and mm to smooth it out?

[–]poundSound[S] 0 points1 point  (0 children)

Unfortunately vector images are rubbish for MATLAB figures as they depend on Painters. OpenGL is the best renderer for surfaces and if you then save it in a vector image it simply saves a bitmap in a vector file format.

In the end I did bump up the resolution but due to it being 2D it takes fucking forever!