matlab Caxis problem in 2016

2 vues (au cours des 30 derniers jours)
Hung
Hung le 7 Juil 2016
Réponse apportée : Hung le 7 Juil 2016
[grid_x grid_y] = meshgrid(1:size(peaks(15),1), 1:size(peaks(15),2));
figure; surf(grid_x, grid_y, 0*grid_y ,peaks(15))
shading interp; lighting phong;
in version prior to 2016, color beyond caxis will be displayed as the caxis extremum colors without problem. in 2016, color will be displayed with an erroneous dark shade if renderers other than painters have been used. However, painters gives unwanted overthick lines when render which is not professinoal at all.
  2 commentaires
Hung
Hung le 7 Juil 2016
same code from matlab 2012 look like this
Hung
Hung le 7 Juil 2016
while the ugly painters look like this:

Connectez-vous pour commenter.

Réponses (2)

Hung
Hung le 7 Juil 2016
I now realise this is a display card problem. An on board Intel HD4000 cause this error, Radeon 7470 solves the problem

Walter Roberson
Walter Roberson le 7 Juil 2016
I find that a lot of the apparent difference in color range goes away when I ensure that I am using the same colormap between the two (I am testing R2016a and R2012a as you mentioned those.)
There is still a notable difference between the images after that, but I realized that really it is a difference in the algorithm used to decide how to magnify small images to larger windows. peaks(15) is only 15 x 15 and by default when drawn by itself that gets magnified rather than taking only 15 x 15 pixels.
  2 commentaires
Hung
Hung le 7 Juil 2016
if you switch between zbuffer, opengl and painters
set(gcf, 'renderer', 'opengl') or set(gcf, 'renderer', 'zbuffer') or set(gcf, 'renderer', 'painters')
you will see occurrance of buggy ugly patches.
Walter Roberson
Walter Roberson le 7 Juil 2016
In R2016a all I am seeing is differences in how the three choose to interpolate small images into larger areas.
For my test I am using
pcolor(grid_x, grid_y, peaks(15))
shading interp; lighting phong; colorbar(); caxis([-1 1]);
colormap(jet(256))
pcolor and surf are the same basic surface algorithms but pcolor always uses z = 0 (the same as what you were generating) and pcolor uses its third parameter as the color information, and uses view([0 90]) . Also pcolor defaults to 'edgecolor', 'none' whereas your surf() is defaulting to 'edgecolor', 'k'

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by