Matlab画出漂亮的三维散点图

您所在的位置:网站首页 字母c的设计图案怎么画好看一点 Matlab画出漂亮的三维散点图

Matlab画出漂亮的三维散点图

2024-07-10 13:01:24| 来源: 网络整理| 查看: 265

load('modeltestdata')j加载作图数据,其中仅包含一个名为“num”的二维数组

作图数据 “num” 为8行,11列的一个二维数组,第一列为x轴坐标,第二列为y轴坐标,第3到11列为9组z轴坐标

作图时删掉第一列表头

X-axisY-aixsV=0.150.230.350.450.550.650.750.8519-995.3694.992.1690.6287.5585.4383.2579.9575.615-581.9380.0277.5875.6473.7571.6469.5967.9264.570067.0265.1262.6859.9357.153.650.5946.5843.385081.2679.5576.3575.8373.5871.6569.1867.6563.927089.6489.4686.6385.9883.7481.9279.7878.574.949095.895.0493.4491.0790.6287.7885.9182.9877.55583.8981.1578.9177.8576.474.5373.0971.0767.599996.6595.449492.9891.4989.8787.7684.9778.61

clear clc close all

load('modeltestdata')

V_015 = num(1:8,3); V_023 = num(1:8,4); V_035 = num(1:8,5); V_045 = num(1:8,6); V_055 = num(1:8,7); V_065 = num(1:8,8); V_075 = num(1:8,9); V_085 = num(1:8,10); V_100 = num(1:8,11);

color_light = [0, 1, 1];    %设置渐变色的浅色 三个数为matlab中的颜色的RGB数值 color_dark = [0.5 0 0];         %设置渐变色的深色

dataNum = 9;        %有几组渐变颜色的数据

colour_col1 = (color_light(1) : (color_dark(1)-color_light(1))/(dataNum-1) : color_dark(1))'; colour_col2 = (color_light(2) : (color_dark(2)-color_light(2))/(dataNum-1) : color_dark(2))'; colour_col3 = (color_light(3) : (color_dark(3)-color_light(3))/(dataNum-1) : color_dark(3))'; colour = [colour_col1,colour_col2,colour_col3];

x_axis = num(1:8,1);     y_axis = num(1:8,2);    

figure(1); p1 = scatter3(x_axis, y_axis, V_015, 36, colour(1,:), 'filled'); hold on p2 = scatter3(x_axis, y_axis, V_023, 36, colour(2,:), 'filled'); hold on p3 = scatter3(x_axis, y_axis, V_035, 36, colour(3,:), 'filled'); hold on p4 = scatter3(x_axis, y_axis, V_045, 36, colour(4,:), 'filled'); hold on p5 = scatter3(x_axis, y_axis, V_055, 36, colour(5,:), 'filled'); hold on p6 = scatter3(x_axis, y_axis, V_065, 36, colour(6,:), 'filled'); hold on p7 = scatter3(x_axis, y_axis, V_075, 36, colour(7,:), 'filled'); hold on p8 = scatter3(x_axis, y_axis, V_085, 36, colour(8,:), 'filled'); hold on p9 = scatter3(x_axis, y_axis, V_100, 36, colour(9,:), 'filled');

%绘制投影点 projectSpot = 30 * ones(8,1); hold on  plot3(x_axis, y_axis, projectSpot, '*');

%投影辅助线绘制 assistLine1_z = num(1,3:11)'; assistLine1_z(9,1) = 30; assistLine1_x = num(1,1) * ones(9,1); assistLine1_y = num(1,2) * ones(9,1); hold on  plot3(assistLine1_x, assistLine1_y, assistLine1_z, '--b')

assistLine2_z = num(2,3:11)'; assistLine2_z(9,1) = 30; assistLine2_x = num(2,1) * ones(9,1); assistLine2_y = num(2,2) * ones(9,1); hold on  plot3(assistLine2_x, assistLine2_y, assistLine2_z, '--b')

assistLine3_z = num(3,3:11)'; assistLine3_z(9,1) = 30; assistLine3_x = num(3,1) * ones(9,1); assistLine3_y = num(3,2) * ones(9,1); hold on  plot3(assistLine3_x, assistLine3_y, assistLine3_z, '--b')

assistLine4_z = num(4,3:11)'; assistLine4_z(9,1) = 30; assistLine4_x = num(4,1) * ones(9,1); assistLine4_y = num(4,2) * ones(9,1); hold on  plot3(assistLine4_x, assistLine4_y, assistLine4_z, '--b')

assistLine5_z = num(5,3:11)'; assistLine5_z(9,1) = 30; assistLine5_x = num(5,1) * ones(9,1); assistLine5_y = num(5,2) * ones(9,1); hold on  plot3(assistLine5_x, assistLine5_y, assistLine5_z, '--b')

assistLine6_z = num(6,3:11)'; assistLine6_z(9,1) = 30; assistLine6_x = num(6,1) * ones(9,1); assistLine6_y = num(6,2) * ones(9,1); hold on  plot3(assistLine6_x, assistLine6_y, assistLine6_z, '--b')

assistLine7_z = num(7,3:11)'; assistLine7_z(9,1) = 30; assistLine7_x = num(7,1) * ones(9,1); assistLine7_y = num(7,2) * ones(9,1); hold on  plot3(assistLine7_x, assistLine7_y, assistLine7_z, '--b')

assistLine8_z = num(8,3:11)'; assistLine8_z(9,1) = 30; assistLine8_x = num(8,1) * ones(9,1); assistLine8_y = num(8,2) * ones(9,1); hold on  plot3(assistLine8_x, assistLine8_y, assistLine8_z, '--b')

%设置坐标轴lable x1=xlabel('上游推进器角度(°)'); %x轴标题 x2=ylabel('下游推进器角度(°)'); %y轴标题 x3=zlabel('下游推进器螺旋桨推力(N)'); %z轴标题 set(x1,'position', [5 -3 10], 'Rotation',4); %x轴名称旋转 set(x2,'position', [0.5 1 10], 'Rotation',-42); %y轴名称旋转

%设置图例 legend([p1(1),p2(1),p3(1),p4(1),p5(1),p6(1),p7(1),p8(1),p9(1)],'V=0.15m/s','V=0.23m/s','V=0.35m/s','V=0.45m/s','V=0.55m/s','V=0.65m/s','V=0.75m/s','V=0.85m/s','V=1.00m/s'...     , 'Location', 'best')

%设置图片显示角度 view(-19,22)

%保存图片 saveas(gcf, 'modeltest_Tp.svg') disp('Picture is successfully saved!')

 



【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭