How many template of 3D graph exist in Matlab ?
Show older comments
As we know there is a lot template for sketch the 3D graph in matlab like real imaginary absolute and contour and density and so on how we can gether them in one package any one have it?
Answers (3)
dpb
on 5 Oct 2024
2 votes
I don't know what is meant, specifically, with the reference to the data classes; particularly imaginary as MATLAB grpahics don't display imaginary values at all, but probably the best compendium of the available graphs is in the <base documentation link to 2D and 3D graphs>. The others available in extended toolboxes are not gathered in any one place that I'm aware of although a number are overloaded functions that will operate on various specialty axes (like mapping) or handle specific subject areas.
It is difficult as the universe keeps expanding to have any idea of all that are available, indeed, agreed...
10 Comments
Yep. Many tools in MATLAB that produce figures, in a large and growing variety of forms. Some in different packages, different toolboxes. That is especially so if we consider 2-d. But even if we stick to 3-d, there is no complete list of everything specific to 3-d graphics only.
help graph3d
So there are some graphic "primitives", things like plot3, mesh, surf, fill, patch, fill3. Pretty much everything else will be just an eventual call to some primitive.
To that we can add tools like fsurf, and isosurface, which are just extensions of surf. Tools like scatter3, so extensions of plot3. We can find many of those extensions in specgraph.
help specgraph
And we can also find tools from other places, where plot has been overloaded to generate graphics from specific classes. The most obvious cases I can think of off the top of my head are things like plot, as applied to a polyshape, or to a graph, or to a curve fitting object. I'm sure others could add to that list of course.
salim
on 5 Oct 2024
John D'Errico
on 5 Oct 2024
No. I won't/can't possibly give you the documentation for every possible 3-d tool in MATLAB. That documentation is already written anyway.
As we showed you, there are many such codes. I even gave you a very good list to start. Look at ANY code in those lists that end with the number 3. Read the help. If you cannot read the help, then how will you read anything we write anyway?
Start with those that seem of interest to you. Again, anything that ends with the number 3 in the name. If you don't know MATLAB well, then it is time to start learning!
Walter Roberson
on 5 Oct 2024
salim
on 5 Oct 2024
salim
on 5 Oct 2024
@salim saeed, I don't know what you think a template is/would be that would let you "just transfer in[to] it and take the graph for article " but it sounds as if you're asking somebody to write code for your specific purpose without you doing the work...the forum doesn't work that way; it isn't a general consulting platform.
If you need a specific plot matching the images you posted, MATLAB doesn't have one of those pre-packaged; it undoubtedly could be produced by combining the various available forms and there are even some examples that show some things that are similar but the specific graph itself will have to be built from those base pieces.
Sometimes if foks ask and provide attempts that show an effort to solve the problem and provide representative data to let the forum volunteers have something to work with, they will do amazing things in response, but generally generic questions without such background won't inspire anybody to try to invent something from scratch without that illustration that the poster has invested at least some effort first...
If, however, your expectation is to have a working function provided without further effort on your part and without investing some time and effort into learning MATLAB, your best path will be to hire a consultant.
John D'Errico
on 6 Oct 2024
Edited: John D'Errico
on 6 Oct 2024
NO. I am not trying to destroy your morale. Instead I am telling you there are no templates of the kind you are searching for. At best, there is one (or more) line in the help of each function.
help plot3
For example, in the help for plot3, you will find some basic calling sequences, where if you follow them, they will yield a valid result.
plot3(X,Y,Z)
plot3(X,Y,Z,LineSpec)
plot3(X1,Y1,Z1,...,Xn,Yn,Zn)
plot3(X1,Y1,Z1,LineSpec1,...,Xn,Yn,Zn,LineSpecn)
It is not that we do not wish to share a template with you. There are no templates that you can just click on and get the result you desire to see. MATLAB is not Excel. As I said, if you need to use MATLAB, then you need to read the help. In there, you will find examples of how to call the codes. And that is as close as we can come.
dpb
on 6 Oct 2024
@salim saeed, <TECPLOT, an alternative plotting package> does have many other prepackaged forms; although I doubt even it has precisely the above. It, however, is not inexpensive, either.
And, to hopefully get your morale/optimism back up; it may not be nearly as much effort to create something like or close to the examples as you may think...
Z = peaks; % draw a surface w/ contours
sc = surfc(Z);
hold on % let add more w/o erasing
hAx=axes('Position',[0.7 0.7 0.25 0.20]); % another axis overlaying this one
hL=plot(hAx,Z(:,fix(width(Z)/2)),'linewidth',2); % draw a line into it of the data
xlim([0 50]), xticks([0:10:50]) % neaten it up a little...
ylabel(hAx,'Magnitude')
The rest will be created by using a subplot or tiledlayout arranged to place a matrix of axes in a given figure, it may be necessary to use the venerable subplot() here because I don't think you can put the second axis on top of another one in the tiledlayout--I think I recall having tried that and discovering it doesn't allow it.
The other plot could be as simple as
figure
hP=pcolor(Z);
hP.EdgeColor='none';
and then enhancements...
Don't let the need to write a few MATLAB commands overwhelm you...start in and try something...
3 Comments
ADDENDUM: I did play a little with subplot to add the second axes; I was able to create the effect in the second suplot area (2,2,2); I've yet to figure out how to get the same effect in the (2,2,1) position; it's not really an intended functionality it appears. I suspect there is some way to make it work, but it may take a fair amount of fiddling around with -- there's where a Mathworks whizard may drop by and know the ins and outs well enough to accomplish it...
The other alternative, albeit more effort is to be able to make the individual plots and then export them into another package that will let you arrange them as desired.
salim
on 7 Oct 2024
Bruno Luong
on 7 Oct 2024
@dpb possibly using GUIDE or AppDesigner to place the axes, a step forward to a so called "template"
Walter Roberson
on 7 Oct 2024
Edited: Walter Roberson
on 7 Oct 2024
0 votes
How many template of 3D graph exist in Matlab ?
No templates of 3D graphs exist in MATLAB.
No templates of 2D graphs exist in MATLAB either.
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

