Is there a way to tell Matlab not to steal window focus (from an external editor) such as Emacs) upon graphical commands such as figure
and plot
. This would increase my productivity a lot because I often want to continue code development during data (re-)processing.
相关问题
- Extract matrix elements using a vector of column i
- Plotting multiple columns with ggplot2 [duplicate]
- How do you get R's null and residual deviance
- R markov chain package, is possible to set the coo
- How to display an image represented by three matri
相关文章
- How to plot smoother curves in R
- How to add clipboard support to Matplotlib figures
- Adding a legend to a matplotlib boxplot with multi
- How do I append metadata to an image in Matlab?
- How can I write-protect the Matlab language?
- `std::sin` is wrong in the last bit
- Escape sequence to display apostrophe in MATLAB
- R plot legend with transparent background
It is possible, the trick is to not use the figure statement, but to change the current figure directly. This will change the active plot without changing the focus. Typically I do something like this:
Then, all of the figure(h) statements need to be changed to change_curent_figure(h).
Note, this is included in the matlab documentation.
It should be noted, this only works if the figure is already created. If new figures are going to be periodically created, one could create the figures as the very first few lines of code, save the handles, do the processing, and then plot to them. This example would work. Note, the drawnow command will flush the event buffer, making sure all figures are plotted.
I've seen this work from 2007-2010, not sure if the latest or earlier versions support this, although I have no reason to suspect they don't.
I've got the same question, with the additional complexity that the code creating figures came from an external supplier, and I didn't want to modify it. Here are two possibilities (identified with the help of MathWorks support) tested on Matlab 2014b:
1. Generate the figures without showing them, then show them after the code completion
This code does exactly what's needed, but the added inconvenience is that you cannot see any progress of your code run, thus being unable to interrupt a long run if something goes wrong.
2. Dock the figures
Create a new figure:
Dock it:
This will put the figure into the Matlab IDE window.
Make new figures docked and run the code: