## Data Visualization Via MATLAB (3 dimensional data)

The three dimensinal data are composed of $m\cdot n\cdot l$ matrix. Its data also has the position matrix. (x,y,z). We can plot the isosurface, contourlines, slice plots etc for this kind of data.

### 3d Contour Surface Plots

We should extract the contour data via the function `isosurface`

. Though I have completed the figure, I can’t understand the reason. I will give issulation later.

`1` | `% As a study of 3D data visualization using MATLAB` |

`2` | `% Author Zhaohua Tian` |

`3` | `% Email:knifelees3@gmail.com` |

`4` | `% The figures in the Ref: "Quantum photonic node for on-chip state transfer" (https://arxiv.org/abs/1908.03683)` |

`5` | `A=dlmread('../3D_Animation/BigRangeSweep3Cav.txt');` |

`6` | `num_J12=199;` |

`7` | `num_J23=200;` |

`8` | `num_kappa=201;` |

`9` | `max_sym=reshape(A,[num_J12,num_J23,num_kappa]);` |

`10` | |

`11` | |

`12` | `J12_mat=linspace(1,9,num_J12);` |

`13` | `J23_mat=linspace(1,10,num_J23);` |

`14` | `kappa_mat=linspace(1,28,num_kappa);` |

`15` | `[xx,yy,zz]=meshgrid(J23_mat,J12_mat,kappa_mat);` |

`16` | |

`17` | `%%` |

`18` | `%get the figures` |

`19` | `h=figure(1)` |

`20` | `ax = axes('Parent',h);` |

`21` | `p1 = patch(isosurface(xx,yy,zz,max_sym,0.8));` |

`22` | `isonormals(xx,yy,zz,max_sym,p1)` |

`23` | `p1.FaceAlpha=0.15;` |

`24` | `p1.FaceColor=[0,0.3 0.3];` |

`25` | `p1.EdgeColor='none';` |

`26` | `hold on` |

`27` | |

`28` | `p2 = patch(isosurface(xx,yy,zz,max_sym,0.9));` |

`29` | `isonormals(xx,yy,zz,max_sym,p2)` |

`30` | `p2.FaceAlpha=0.3;` |

`31` | `p2.FaceColor=[0 0.7 0.7];` |

`32` | `p2.EdgeColor='none';` |

`33` | `hold on` |

`34` | |

`35` | `p3 = patch(isosurface(xx,yy,zz,max_sym,0.97));` |

`36` | `isonormals(xx,yy,zz,max_sym,p3)` |

`37` | `p3.FaceAlpha=0.4;` |

`38` | `p3.FaceColor=[0 0 0.8];` |

`39` | `p3.EdgeColor='none';` |

`40` | `hold on` |

`41` | `%daspect([1 1 1])` |

`42` | `view(135,20); ` |

`43` | `axis tight` |

`44` | `%camlight('headlight','infinite')` |

`45` | `lighting('flat')` |

`46` | `box('on')` |

`47` | `lighting gouraud` |

`48` | `xlabel('J_{12}/g')` |

`49` | `ylabel('J_{23}/g')` |

`50` | `zlabel('Kappa/g')` |

`51` | `print('./sym_distri_static_MATLAB.png', '-dpng', '-r600')` |

`52` | `% axis('off')` |

`53` | `% print('../Figures/BigRangePureFig.png', '-dpng', '-r600')` |

`54` | `% axis('on')` |

`55` | `% p1.FaceColor='none';` |

`56` | `% p2.FaceColor='none';` |

`57` | `% p3.FaceColor='none';` |

`58` | `% print('../Figures/BigRangeFrame.eps', '-depsc', '-r600')` |

The generated plot are as follows