Mathematica中文论坛-非官方

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 6870|回复: 0
打印 上一主题 下一主题

豆粑粑 matlab scatter high dimensions tensor visualization, multi colorbar

[复制链接]

532

主题

602

帖子

3031

积分

论坛元老

Rank: 8Rank: 8

积分
3031
跳转到指定楼层
楼主
发表于 2017-8-29 15:31:45 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 meatball1982 于 2017-11-30 08:53 编辑

matlab scatter high dimensions tensor visualization





  1. clear all
  2. clc
  3. clf

  4. %% outline
  5. % plot tensor with value in one figure.

  6. %% main

  7. % point number --------------------------------
  8. n=400;         
  9. % generate x,y,z  -----------------------------
  10. z = linspace(0,4*pi,n)+rand(1,n)*0.2;
  11. x = 2*cos(z) + [1:n]/50.*rand(1,n);
  12. y = 2*sin(z) + [1:n]/80.*rand(1,n);

  13. % point properties v1,v2,...,v8  --------------
  14. v1 = (10*abs(z)+10).*rand(size(z));
  15. v2 = z + 4  ;
  16. v3 = sin(z/2*0.2*pi)+2;
  17. v4 = log(z+2);
  18. v5 = cos((pi*0.1*y).^0.5) +2  ;
  19. v6 = y+2;
  20. v7 = sin(pi*log(z+1))+2;
  21. v8 = cos(pi*log(z+1))+2;

  22. % plot parameter -------------------------------
  23. xmin= -10;xmax = 15;
  24. ymin= -10;ymax = 15;
  25. zmin=  0;zmax = 15;

  26. % view point ----------------------------------
  27. vx = -50; vy = 20;

  28. % fontsize ------------------------------------
  29. mm_fz = 12;

  30. % set fig size --------------------------------
  31. fig_pos = [0.09 0.15 0.53 0.75];
  32. axis_pos= [xmin xmax ymin ymax zmin zmax];

  33. % plot 3D points ------------------------------
  34. h=figure(1);
  35. set(h, 'Position', [100, 100, 800, 500]);

  36. % plot zeros plane ------------------------------
  37. ax1 = axes;
  38. set(ax1,'position',fig_pos );
  39. h_1 = scatter3(ax1,x,y,zeros(size(x)),3*v3,v4,'o','filled');
  40. box on
  41. hidden off
  42. axis(axis_pos );
  43. view([vx,vy])
  44. colormap(ax1,summer);
  45. xlabel('IamX')
  46. ylabel('IamY')
  47. zlabel('IamZ')
  48. title('IamTitle')


  49. % plot x plane ------------------------------
  50. ax2 = axes;
  51. set(ax2,'position',fig_pos);
  52. h_2 = scatter3(ax2,xmax*ones(size(x)),y,z,7*v5,v6,'s','filled');
  53. box off
  54. axis off
  55. hidden off
  56. axis(axis_pos );
  57. view([vx,vy])
  58. colormap(ax2,'pink');


  59. % plot y plane ------------------------------
  60. ax3 = axes;
  61. set(ax3,'position',fig_pos);
  62. h_3 = scatter3(ax3,x,ymax*ones(size(y)),z,8*v7,v8,'^','filled');
  63. box off
  64. axis off
  65. hidden off
  66. axis(axis_pos );
  67. view([vx,vy])
  68. colormap(ax3,'cool');

  69. % plot xyz  ------------------------------
  70. ax4 = axes;
  71. set(ax4,'position',fig_pos);
  72. h_4 = scatter3(ax4,x,y,z,1.1*v1,v2,'o','filled');
  73. % box off
  74. axis off
  75. hidden off
  76. axis(axis_pos );
  77. view([vx,vy])
  78. colormap(ax4,'jet');

  79. % set colorbar --------------------------------
  80. cb1 = colorbar(ax1,'Position',[.65  .15 .05 .6]);
  81. cb2 = colorbar(ax2,'Position',[.74  .15 .05 .6]);
  82. cb3 = colorbar(ax3,'Position',[.83   .15 .05 .6]);
  83. cb3 = colorbar(ax4,'Position',[.92   .15 .05 .6]);

  84. % set fontsize --------------------------------
  85. set(ax1,'fontsize',mm_fz)
  86. set(ax2,'fontsize',mm_fz)
  87. set(ax3,'fontsize',mm_fz)
  88. set(ax4,'fontsize',mm_fz)


  89. h=gcf;
  90. fi_na=['./fig_8_val_3D'];
  91. % fun_work_li_035_myfig_out(h,fi_na,3);

  92. %% plot point properties ---------------------------
  93. % clf
  94. % sbp_width=0.8;
  95. % sbp_heig=0.75;
  96. % n_row = 4;
  97. % n_col = 3;
  98. % [out_pos]=fun_mm_subplot_pos(n_row,n_col,sbp_width,sbp_heig);
  99. % h=figure(2)
  100. % set(h, 'Position', [100, 100, 800, 600]);
  101. %
  102. % ax=axes('position',out_pos(1,:));
  103. % plot(x,'.')
  104. % title('x');
  105. % ax=axes('position',out_pos(2,:));
  106. % plot(y,'.')
  107. % title('y');
  108. % ax=axes('position',out_pos(3,:));
  109. % plot(z,'.')
  110. % title('z');
  111. %
  112. % ax=axes('position',out_pos(4,:));
  113. % plot(v1,'.')
  114. % title('v1');
  115. % ax=axes('position',out_pos(5,:));
  116. % plot(v2,'.')
  117. % title('v2');
  118. % ax=axes('position',out_pos(6,:));
  119. % plot(v3,'.')
  120. % title('v3');
  121. %
  122. % ax=axes('position',out_pos(7,:));
  123. % plot(v4,'.')
  124. % title('v4');
  125. % ax=axes('position',out_pos(8,:));
  126. % plot(v5,'.')
  127. % title('v5');
  128. % ax=axes('position',out_pos(9,:));
  129. % plot(v6,'.')
  130. % title('v6');
  131. %
  132. % ax=axes('position',out_pos(10,:));
  133. % plot(v7,'.')
  134. % title('v7');
  135. % ax=axes('position',out_pos(11,:));
  136. % plot(v8,'.')
  137. % title('v8');
  138. %
  139. %
  140. % h=gcf;
  141. % fi_na=['./fig_8_val_split'];
  142. % fun_work_li_035_myfig_out(h,fi_na,3);
  143. %
复制代码



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|Mathematica中文论坛-非官方 ( 辽ICP备16001491号-1

GMT+8, 2024-4-28 02:15 , Processed in 0.122841 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表