Open figure in editor instead of in new window
46 ビュー (過去 30 日間)
古いコメントを表示
hello,
I've a creatfit function and I want to add the relative figure in editor , instead of launching a new window.
how fix it? tks
2 件のコメント
Jan
2023 年 3 月 1 日
What is a "creatfit function"? What is a "relative figure"? How can a figure be opened in which editor?
回答 (1 件)
DGM
2023 年 3 月 1 日
編集済み: DGM
2023 年 3 月 1 日
If you're asking how to programmatically dock the figure, you can set its 'windowstyle' property.
In order to create a new empty figure, you can do this.
% create an empty docked figure
figure('windowstyle','docked')
At which point, you could plot in it as usual.
You could also set the property of a figure after the fact.
% just put something in a figure
inpict = imread('cameraman.tif');
imshow(inpict)
% dock the figure
set(gcf,'windowstyle','docked') % or use a specific fig handle
3 件のコメント
DGM
2023 年 3 月 1 日
編集済み: DGM
2023 年 3 月 1 日
The exported script creates a new figure, so it won't use any figures created before or afterward. Unless you modify the script, you'll have to set the properties of the new figure after the script creates it.
It works for me when I either do
[fr gof] = createFit(x,y)
set(gcf,'windowstyle','docked')
or alternatively, if I modify the script:
% ...
% Plot fit with data.
figure( 'Name', 'untitled fit 1' , 'windowstyle','docked');
% ...
I think what might be happening is that there is no expected location for the docked figure. You might try docking an empty figure first so that MATLAB knows where you want the docked figure to go.
That said, I'm using R2019b, and lots of things have changed since.
参考
カテゴリ
Help Center および File Exchange で Smoothing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!