フィルターのクリア

How to make an inset of matlab figure inside the figure.

914 ビュー (過去 30 日間)
Hari
Hari 2013 年 1 月 30 日
回答済み: Image Analyst 2023 年 5 月 19 日
In matlab help menu there is an example for making insets for world-map. But I want the inset for a simple graph obtained by solving some differential equations. When I used the same codes in my case, it does not work. I don't know from where to start. Can you provide me the whole program for a simple example.
  1 件のコメント
Jan
Jan 2013 年 1 月 30 日
Please specify more exactly what you want. It does not help that we, that there is any example in any help text. I'm not sure what "insets" are also. Therefore neither providing a complete solution nor an example is possible.

サインインしてコメントする。

採用された回答

Kye Taylor
Kye Taylor 2013 年 1 月 30 日
編集済み: Image Analyst 2018 年 12 月 24 日
Maybe try something like
x1 = linspace(0,1);
x2 = linspace(3/4,1);
y1 = sin(2*pi*x1);
y2 = sin(2*pi*x2);
figure(1)
% plot on large axes
plot(x1,y1)
% create smaller axes in top right, and plot on it
axes('Position',[.7 .7 .2 .2])
box on
plot(x2,y2)
0000 Screenshot.png

その他の回答 (3 件)

Hamid Radmard Rahmani
Hamid Radmard Rahmani 2018 年 12 月 24 日
Hi,
how to switch between small and large figures?
  4 件のコメント
SULIN WANG
SULIN WANG 2019 年 12 月 8 日
Your code works great.
I have anohter question about your code:
if you firstly comment the code
close all % because there may be other figure.
and run your code one more time, you will see that
the data (x1, y1, x1, y1b) are ploted under the box ax2.
See the screenshot below:
Question.PNG
I appreciate your help.
WSL
Adeel Yousuf
Adeel Yousuf 2020 年 5 月 2 日
I think it's mainly bcz "hold off" is not written in the code so it plots in the already opened figure. Try including hold(ax1,'off') & hold(ax2,'off') at the end of code.

サインインしてコメントする。


prateek raj gautam
prateek raj gautam 2019 年 6 月 7 日
% Step 1. assign value to plotvariable=?
% Step 2. change range=?
%% plot on plot
clc
clear all
close all
x=1:.1:100
y=x.^-2+sin(x)
%% assign yor variable here
plotvariable=y% i am using y as my plot variable
plot(plotvariable)
grid on
%% location of subpart on figure
xstart=.6
xend=.8
ystart=.6
yend=.8
axes('position',[xstart ystart xend-xstart yend-ystart ])
box on
%% define range of subpart
range=90:110% here i am using range from 90 to 110
plot(range,plotvariable(1,range))% here i am plotting sub part of same figure. you plot another figure
grid on
fig_1.png

Image Analyst
Image Analyst 2023 年 5 月 19 日

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by