What type of Build in function used for plot such graph? or how to plot such graph?

 Accepted Answer

The plot3 function will do this.
help plot3
PLOT3 Plot lines and points in 3-D space. PLOT3() is a three-dimensional analogue of PLOT(). PLOT3(x,y,z), where x, y and z are three vectors of the same length, plots a line in 3-space through the points whose coordinates are the elements of x, y and z. PLOT3(X,Y,Z), where X, Y and Z are three matrices of the same size, plots several lines obtained from the columns of X, Y and Z. Various line types, plot symbols and colors may be obtained with PLOT3(X,Y,Z,s) where s is a 1, 2 or 3 character string made from the characters listed under the PLOT command. PLOT3(x1,y1,z1,s1,x2,y2,z2,s2,x3,y3,z3,s3,...) combines the plots defined by the (x,y,z,s) fourtuples, where the x's, y's and z's are vectors or matrices and the s's are strings. Example: A helix: t = 0:pi/50:10*pi; plot3(sin(t),cos(t),t); PLOT3 returns a column vector of handles to lineseries objects, one handle per line. The X,Y,Z triples, or X,Y,Z,S quads, can be followed by parameter/value pairs to specify additional properties of the lines. See also PLOT, LINE, AXIS, VIEW, MESH, SURF. Documentation for plot3 doc plot3 Other functions named plot3 embedded.fi/plot3

4 Comments

please help me as much as posssible. I want plot the graph which consists
X=1:136;
Y= five element ( base case, dg1,dg2,dg3,dg4)
Z= values of the five element for each x value
for the data see xlsx file
If you have more x values than y and z it is not possible to create a plot.
What have you done to load this excel file to Matlab variables?
Workaround as follows:
clear; clc;
rawdata = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/915159/branch%20loss%20for%20all%20case.xlsx');
figure
ax = gca;
plot3(ax,1:length(rawdata),repelem(1,1,length(rawdata)),rawdata(:,1),'b--');
hold(ax,'on')
grid(ax,'on');
for k = 2:5
plot3(ax,1:length(rawdata),repelem(k,1,length(rawdata)),rawdata(:,k));
end
hold(ax,'off');
xlabel(ax,'Branch');
zlabel(ax,'Branch power loss (kW)');
ylabel(ax,'DSTATCOM');
ax.YTickLabel={'base case','dg1','dg2','dg3','dg4'};
Thank you!!!!!!!!!!
this is realy what i want.

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Asked:

on 24 Feb 2022

Commented:

on 5 Mar 2022

Community Treasure Hunt

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

Start Hunting!