The distinction between MATLAB Basics and Advanced MATLAB is a somewhat arbitrary distinction. The heuristic I use is “If I knew it before I came to The MathWorks, it is basic.” It is as good of a rule as any.
Some might argue this is a more basic post, but the inclusion of the gotcha and the use of property value pairs made this an advanced topic in my mind.
This short video shows how to put multiple subplots on a figure. Axes of different sizes can be laid out. The use of the position property is covered. A common gotcha is shown also where one axis overlapping another will delete the first.
That seems a little extreme to have 393 plot windows open. Having more than a dozen windows open in a Windows OS seems difficult to manage. I would try to think of a more effective way to display your data.
Maybe a GUI that allows you to select the graph you are interested in would be better. Maybe an animation is more what you need.
thanks for the hint: I finally understood the “position” command applied to subplot, and that dimensions are given in percentage of figure width and height.
got a simple question here, I’m making an interface for an image compression project. I needed to generate several subplots for the histogram, but here lies the problem. After generating all the subplots (which I put inside a panel, not axes) I simply can’t remove/clear/reset those subplots, which I need to do to make my ‘Clear’ pushbutton works as it is assigned to do.
I need your help in plotting a time-series data set and in the form of sub-plots.My domain size is 362 X 181 and like that there are 12 data sets.I need to plot all these 12 data sets of same dimension and animate later.
I need to make a script so that,it is operational.
I strucked from last four days to do this.
Thanking you in advance
With this nice demo, I now know what my problem is (something is overlaping), causing the first title not to be displayed and all titles moved up one histogram, with the last without a title.
The question is: how do you solve this problem?
I’ve shortened the titles as much as possible, but to no avail?
Suggestions?
The property section of the subplots is not thorough in the documentation and I note that the relative order of property statements can also produce bilwildering results.
Looks like an area that needs some work or at least more documentation to allow workers to work around such problems.
I am not sure what you are talking about. It is much better for us to be able to help if you can show the shortest code snippet that will reproduce the behavior.
I have a problem in Matlab, and I hope you can help me with it. I am solving a Differential Equation in Matlab using Matlab’s own functions, for different values of some parameters. For some values of the parameter, it takes too long and I stop the program by a Ctrl-C manually, and then change the parameter.
Is there a way to automate this? i.e., the program should itself figure out that it took more than say some specific amount of time and so it should move to the next parameter.
I hope you got the question.
Your comments would be greatly appreciated !
Thanks in advance.
There’s no “timeout” capability for the ODE solvers. However, it sounds like the stiffness of your ODEs may depend on the parameters. Cleve wrote a column on ODEs and stiffness here:
You should try switching your program to use a stiffer solver to try to reduce the amount of time it takes to solve the ODE when it’s stiff. There’s a table in the function reference page for the ODE solvers that describes which solvers are stiff solvers and which aren’t.
I finished my work by the manual bull-work, but it wd still be helpful to know if there is any way at all. I am solving a BVP; I don’t know if your comments on stiffness would still help. Do you have some other suggestions about my problem?
Thanks
Leave a Reply
About
Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.
It was just pointed out that there is a typo at two minutes into the video. The title of the subplot on the right should be:
h=subplot(‘position’, [0.6 0.1 0.3 0.8])
Sorry!
Doug
Hi,
Could you please give code to plot say 2 subplots side-by-side with the axes obeying the golden ratio?
thanks
a.
Antunes,
You should be able to do that with the ‘position’ property value pair. Just get the length and width in ratio and then position appropriately.
Doug
Hello,
I am trying to plot data in 393 plots with each figure include 25 plots. Any help is really appreciated.
Bassam,
That seems a little extreme to have 393 plot windows open. Having more than a dozen windows open in a Windows OS seems difficult to manage. I would try to think of a more effective way to display your data.
Maybe a GUI that allows you to select the graph you are interested in would be better. Maybe an animation is more what you need.
Doug
thanks for the hint: I finally understood the “position” command applied to subplot, and that dimensions are given in percentage of figure width and height.
Hi Doug,
got a simple question here, I’m making an interface for an image compression project. I needed to generate several subplots for the histogram, but here lies the problem. After generating all the subplots (which I put inside a panel, not axes) I simply can’t remove/clear/reset those subplots, which I need to do to make my ‘Clear’ pushbutton works as it is assigned to do.
a quick reply would be nice..
regards
Fikri
Fikri, see CLA.
Hai Doug
I need your help in plotting a time-series data set and in the form of sub-plots.My domain size is 362 X 181 and like that there are 12 data sets.I need to plot all these 12 data sets of same dimension and animate later.
I need to make a script so that,it is operational.
I strucked from last four days to do this.
Thanking you in advance
regards
jitendra
jitendra,
I am not sure I understand your question. Please contact support for help.
Doug
With this nice demo, I now know what my problem is (something is overlaping), causing the first title not to be displayed and all titles moved up one histogram, with the last without a title.
The question is: how do you solve this problem?
I’ve shortened the titles as much as possible, but to no avail?
Suggestions?
The property section of the subplots is not thorough in the documentation and I note that the relative order of property statements can also produce bilwildering results.
Looks like an area that needs some work or at least more documentation to allow workers to work around such problems.
Thank you.
S.G.
I am not sure what you are talking about. It is much better for us to be able to help if you can show the shortest code snippet that will reproduce the behavior.
Thanks,
Doug
Hi Doug,
I have a problem in Matlab, and I hope you can help me with it. I am solving a Differential Equation in Matlab using Matlab’s own functions, for different values of some parameters. For some values of the parameter, it takes too long and I stop the program by a Ctrl-C manually, and then change the parameter.
Is there a way to automate this? i.e., the program should itself figure out that it took more than say some specific amount of time and so it should move to the next parameter.
I hope you got the question.
Your comments would be greatly appreciated !
Thanks in advance.
Rashmish
Rashmish,
There’s no “timeout” capability for the ODE solvers. However, it sounds like the stiffness of your ODEs may depend on the parameters. Cleve wrote a column on ODEs and stiffness here:
http://www.mathworks.com/company/newsletters/news_notes/clevescorner/may03_cleve.html
You should try switching your program to use a stiffer solver to try to reduce the amount of time it takes to solve the ODE when it’s stiff. There’s a table in the function reference page for the ODE solvers that describes which solvers are stiff solvers and which aren’t.
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/ode113.html?BB=1
If you’re currently using ODE45, try ODE15S or ODE23S.
I finished my work by the manual bull-work, but it wd still be helpful to know if there is any way at all. I am solving a BVP; I don’t know if your comments on stiffness would still help. Do you have some other suggestions about my problem?
Thanks