0

Code

tfr = abs ( tfr ); [row_size, column_size] = size(tfr);  
tfr = tfr(1:round(row_size/2), 1:row_size);
surf(tfr); view(2); 

I get in R2014b of OSX 10.10.3 Yosemite

enter image description here

but rotating around shows that the cells should not be black

enter image description here

Why is the output black? I wonder if this is a hardware problem or not.

Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
  • 3
    Please post runnable code. My bet: `trf` is very large and you only see the black edges of the surface. Try `surf(trf, 'edgecolor', 'none')` – Luis Mendo Jun 22 '15 at 12:26
  • Works! Make it an answer so I accept it. Please, also explain how you came up with the solution. Why is this solution working? Why not something else? – Léo Léopold Hertz 준영 Jun 22 '15 at 12:28
  • 1
    Done. It's just that the surface has so many edges that they cover everything – Luis Mendo Jun 22 '15 at 12:39
  • @LuisMendo Can there be any other features than disturbs the clarity of the picture? Which features do you recommend to set off? – Léo Léopold Hertz 준영 Jun 22 '15 at 12:40
  • 1
    Not that I know of. If the surface is very complex you may want to assign some transparency by means of the `'facealpha'` property. That allows to see through the surface. But of course the colours are affected by that – Luis Mendo Jun 22 '15 at 13:51

1 Answers1

2

My bet is that trf is a very large matrix. In these cases, the surface has so many edges (coloured black by default) that they completely clutter the image, and you don't see the surface patches

One solution for that is to remove the edges:

surf(trf, 'edgecolor', 'none').

Example: with

trf = rand(500,500);

the following figures respectively show the result of surf(trf) and surf(trf, 'edgecolor', 'none').

enter image description here enter image description here

Luis Mendo
  • 110,752
  • 13
  • 76
  • 147
  • How do you have data which is open from both ends? Like sharp ends? It looks nice! How have you prepared it? I have just `abs(data)` in reformatting the data. If you halve the rows, you probably would get also data like me. Or do you periodize the data? – Léo Léopold Hertz 준영 Jun 22 '15 at 12:45
  • 2
    @Masi The dataponts in the example are uniformly distributed random numbers between 0 and 1, generated my Matlab's `rand` command. – Matt Jun 22 '15 at 13:13