简体   繁体   中英

Matlab plot3 for specific point

I am problem with plot3 .

I have X , Y and TIME which are 32656*1 double matrix and I used plot3(X,Y,TIME); .

Now I have a value taken from TIME .

How can I plot that on the graph like scatter?

I feel like I should give this an answer addressing what I think is the problem, although the wording in the question is still a bit unclear.

Given a data set X and Y plotted over TIME values, you could plot the data on the same graph using hold , like so:

%// Plots the data in a new figure window
figure;
hold on;
scatter(TIME, X);
scatter(TIME, Y);

hold off;

Or alternatively:

%// Plots the data in a new figure window
figure;
hold on;
plot(TIME, X, 'o', TIME, Y, 'o');

hold off;

Then simply convert the time value so they display properly on the axis of the graph, like so:

%// Convert the time values
set(gca, 'XTickLabel', datestr(TIME, 'HH:MM PM'));

If you haven't parsed the raw data yet and it contains date strings, you also have to call this before you plot it, adjusting it to fit your data:

TIME = datenum(DATA{1});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM