Hi,
I have altitude, density and time data. How can I do line plotting with time sequence, i.e. time, altitude and density in x-, y- and z- axis, respectively (same as one plot attached but without arrows). I don't need contour plot. The density data is different at different times ( I mean sometime less than earlier values). I am using Matlab2015a.
Thank you so much..
Thank you.

댓글 수: 3

dpb
dpb 2020년 6월 6일
Interesting plot...I presume each of the lines above is at a fixed time and the apparent shift is a projection based on height? Not sure otomh of a way to do routinely in ML--have to think about that some.
If you want somebody to explore on your behalf, though, you'll have a lot more chances if you post at least a minimal dataset for folks to play with...
Madan Kumar
Madan Kumar 2020년 6월 7일
I tried all I could, like, plot3,waterfall,line, plot indivual line, etc..but did not get what I want. here is the dendisy data attached.
code for time and altitude;
time=1:11;altitude=80;0.5:115;
Madan Kumar
Madan Kumar 2020년 6월 7일
I think it is the time series (x-axis) of density with altitude along y-axis.

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2020년 6월 6일

0 개 추천

See if waterfall() meets your needs. Or else plot x vs. y for every y vector, moving it along a little bit each time along the x direction b y adding a tiny bit to the y signal.

댓글 수: 4

Madan Kumar
Madan Kumar 2020년 6월 7일
I tried with waterfall(). It doesnot work for me. I think second suggestion might work but I don't know how to move x- a littele bit in plotting. Can you please help me. Thank you.
Try this. Change xIncrement to whatever spacing you think looks best.
% Custom made waterfall plot for Madan by Image Analyst.
clc; % Clear command window.
clear; % Delete all variables.
close all; % Close all figure windows except those created by imtool.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 18;
markerSize = 20;
fprintf('Beginning to run %s.m ...\n', mfilename);
data = importdata('density.txt')
[rows, columns] = size(data)
xIncrement = 200; % Whatever spacing you want.
for col = 1 : columns
thisColumn = data(:, col)
x = thisColumn + col * xIncrement;
y = 1 : length(thisColumn);
plot(x, y, '-', 'LineWidth', 2);
hold on;
end
ylabel('Height (km)', 'FontSize', fontSize);
xlabel('Time (in AST)', 'FontSize', fontSize);
grid on;
g = gcf;
g.WindowState = 'maximized'
fprintf('Done running %s.m ...\n', mfilename);
Madan Kumar
Madan Kumar 2020년 6월 7일
It looks cool but problem is that the x-axis is not time. You have plotted x vs y and x is density here (if I am n't wrong). Altitude is also starting from 0 (zero), it should start from 80 km. I need to plot time(in x-axis), altitude (y-axis) and density; I mean time series of altitude vs density profile. I also tried to use "ax.position" after plotting but no success.
Image Analyst
Image Analyst 2020년 6월 7일
So just get rows instead of columns or vice versa, or plot y vs x instead of x vs y. I think you can figure out the adaptations needed since you're a smart engineer. Let me know if you still can't, and what the rows and columns of the array represent and which (rows or columns) is supposed to go along each axis.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

질문:

2020년 6월 6일

댓글:

2020년 6월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by