What is the best way to show that 2 points a linked together

조회 수: 5 (최근 30일)
Joshua Nagle Nagle
Joshua Nagle Nagle 2018년 11월 27일
답변: Divyajyoti Nayak 2024년 10월 11일
So Im doing windtunnel testing on a model of an ultra van. Currently I have to plot the out line of the van and where the tube holes(read circles) are on the out line. I also have to plot the cp of each point where the tube is(blue). If you look at the file in the bottom you can see what the graph looks like and you can see at the end there are holes that over lap each other in the x postion. This cause the cp graph to overlap with itself a bit. Is there a good way to show which points are which on the cp graph.

답변 (1개)

Divyajyoti Nayak
Divyajyoti Nayak 2024년 10월 11일
I see that you want to show the points on your Cp graph more clearly since the points at the end have very close x values. It would be better to show the Cp values in a 3d plot using the plot3 function.
I extracted the data from the given figure and used the plot3 function to get a 3d line which I think looks clearer.
clear
clc
fig = openfig('w55mph.fig');
axObjs = fig.Children(2)
dataObjs = findobj(fig,'-property','Ydata')
tube_X = dataObjs(2).XData;
tube_Y = dataObjs(2).YData;
tube_Z = zeros(size(tube_X));
cp_X = tube_X;
cp_Y = tube_Y;
cp_Z = dataObjs(1).YData;
figure;
plot3(tube_X,tube_Y,tube_Z, 'o', 'MarkerSize',5, 'LineStyle','-','MarkerEdgeColor','red','Color','green');
hold on
plot3(cp_X, cp_Y, cp_Z,'-*','Color','blue');

카테고리

Help CenterFile Exchange에서 Graphics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by