تبلیغات
مهندسی مکانیک و هوافضا - Create Text Arrow Annotation
 
آخرین مطالب
 
پیوندهای روزانه
Create Text Arrow Annotation

Create a simple line plot and add a text arrow to the figure. Specify the text arrow location in normalized figure coordinates, starting at the point (0.3,0.6) and ending at (0.5,0.5). Specify the text description by setting the String property.

figure
plot(1:10)
x = [0.3 0.5];
y = [0.6 0.5];
annotation('textarrow',x,y,'String','y = x ')

Create Text Box Annotation

Create a simple line plot and add a text box annotation to the figure. Specify the text description by setting the String property. Force the box to fit tightly around the text by setting the FitBoxToText property to 'on'.

figure
plot(1:10)
dim = [.2 .5 .3 .3];
str = 'Straight Line Plot from 1 to 10';
annotation('textbox',dim,'String',str,'FitBoxToText','on');

Create a text box annotation without setting the FitBoxToText property. The text box uses the specified width and height and wraps text as needed.

figure
plot(1:10)
dim = [.2 .5 .3 .3];
str = 'Straight Line Plot from 1 to 10';
annotation('textbox',dim,'String',str)

Create Text Box Annotation with Multiline Text

Create a text box annotation with multiline text by setting the String property to a cell array. Each element of the cell array displays on a separate line. Force the box to fit tightly around the text by setting theFitBoxToText property to 'on'.

figure
plot(1:10)
dim = [0.2 0.5 0.3 0.3];
str = {'Straight Line Plot','from 1 to 10'};
annotation('textbox',dim,'String',str,'FitBoxToText','on');

Create Rectangle Annotation

Create a stem plot and add a rectangle annotation to the figure. Change the color of the rectangle outline by specifying the Color property.

figure
data = [2 4 6 7 8 7 5 2];
stem(data)
dim = [.3 .68 .2 .2];
annotation('rectangle',dim,'Color','red')

Add a second rectangle annotation to the figure. Specify the fill color by setting the FaceColor property. Add transparency by setting the FaceAlpha property to a value between 0 (completely transparent) and 1 (completely opaque).

dim2 = [.74 .56 .1 .1];
annotation('rectangle',dim2,'FaceColor','blue','FaceAlpha',.2)

Create Ellipse Annotation

Create a simple line plot and add an ellipse annotation to the figure. Specify dim as the size and location of the smallest rectangle that encloses the ellipse.

figure
x = linspace(-4,4);
y = x.^3 - 12*x;
plot(x,y)

dim = [.2 .74 .25 .15];
annotation('ellipse',dim)

Draw a red rectangle using the same dimensions to show how the ellipse fills the rectanglular area.

annotation('rectangle',dim,'Color','red')

Combine Two Types of Annotations

Create a simple line plot. Then, add a bent arrow to the graph by combining a line and an arrow annotation.

figure
plot(1:10)

xl = [.3 .3];
yl = [.3 .4];
annotation('line',xl,yl)

xa = [.3 .4];
ya = [.4 .4];
annotation('arrow',xa,ya)

Modify Annotation After Creation

Add a text arrow to a figure and return the annotation text arrow object, a.

figure
plot(1:10)
x = [0.3,0.5];
y = [0.6,0.5];
a = annotation('textarrow',x,y,'String','y = x ');

Modify properties of the annotation text arrow using a. For example, change the color to red and the font size to 14 points.

a.Color = 'red';
a.FontSize = 14;

See the annotation property pages for a list of properties for each type of annotation.

Related Examples

Input Arguments

collapse all

lineType — Type of line annotation'line' | 'arrow' | 'doublearrow' | 'textarrow'

Type of line annotation, specified as one of these values.

ValueType of ObjectExample
'line'Annotation lineannotation('line',[.1 .2],[.1 .2])
'arrow'Annotation arrowannotation('arrow',[.1 .2],[.1 .2])
'doublearrow'Annotation double arrowannotation('doublearrow',[.1 .2],[.1 .2])
'textarrow'

Annotation text arrow. To add text to the tail end of the text arrow, use the String property.

annotation('textarrow',[.1 .2],[.1 .2],'String','my text')

shapeType — Type of shape annotation'rectangle' | 'ellipse' | 'textbox'

Type of shape annotation, specified as one of these values.

ValueType of ObjectExample
'rectangle'Annotation rectangleannotation('rectangle',[.2 .3 .4 .5])
'ellipse'Annotation ellipseannotation('ellipse',[.2 .3 .4 .5])
'textbox'

Annotation text box. To specify the text, set the String property. To automatically adjust the dimensions of the box to fit closely around the text, set the FitBoxToText property to 'on'.

annotation('textbox',[.2 .3 .4 .5],'String','my text','FitBoxToText','on')

x — Beginning and ending x-coordinatestwo-element vector of the form [x_begin x_end]

Beginning and ending x-coordinates, specified as a two-element vector of the form [x_begin x_end]. Together the x and y input arguments determine the endpoints of the line, arrow, double arrow, or text arrow annotation. The annotation extends from the point (x_beginy_begin) to (x_endy_end).

By default, the units are normalized to the figure. The lower left corner of the figure maps to (0,0) and the upper right corner maps to (1,1). To change the units, use the Units property.

Example: x = [.3 .5]

y — Beginning and ending y-coordinatestwo-element vector of the form [x_begin x_end]

Beginning and ending y-coordinates, specified as a two-element vector of the form [y_begin y_end]. Together the x and y input arguments determine the endpoints of the line, arrow, double arrow, or text arrow annotation. The annotation extends from the point (x_beginy_begin) to (x_endy_end).

By default, the units are normalized to the figure. The lower left corner of the figure maps to (0,0) and the upper right corner maps to (1,1). To change the units, use the Units property.

Example: y = [.3 .5]

dim — Size and locationfour-element vector of the form [x y w h]

Size and location, specified as a four-element vector of the form [x y w h]. The first two elements specify the coordinates of the lower left corner of the text box, rectangle, or ellipse with respect to the lower left corner of the figure. The second two elements specify the width and height of the annotation, respectively.

If you are creating an ellipse, then dim is the size and location of the smallest rectangle that encloses the ellipse.

By default, the units are normalized to the figure. The lower left corner of the figure maps to (0,0) and the upper right corner maps to (1,1). To change the units, use the Units property

Example: dim = [.3 .4 .5 .6]

container — Target for annotationfigure object | uipanel object | uitab object

Target for annotation, specified as a figure, uipanel, or uitab object. For example, to add an annotation to a specific figure, specify the figure object as the first input argument to the function.

f = figure;
annotation(f,'line',[.1 .2],[.2 .3])

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: annotation('rectangle',[.5 .5 .1 .1],'EdgeColor','r') creates a rectangle annotation with a red outline.

Each type of annotation object supports a different set of properties. For a full list of properties and descriptions for each type, see the associated property page.

Output Arguments

collapse all

a — Annotation objectscalar

Annotation object, returned as a scalar. The type of annotation object returned depends on the first input argument.

First Input ArgumentType of Object ReturnedProperty Page
'line'Annotation lineAnnotation Line Properties
'arrow'Annotation arrowAnnotation Arrow Properties
'doublearrow'Annotation double arrowAnnotation Double Arrow Properties
'textarrow'Annotation text arrowAnnotation Text Arrow Properties
'textbox'Annotation text boxAnnotation Text Box Properties
'rectangle'Annotation rectangleAnnotation Rectangle Properties
'ellipse'Annotation ellipseAnnotation Ellipse Properties

More About

collapse all

Compatibility Considerations

Starting in R2014b, annotations cannot cross uipanel boundaries. Instead, they clip at the boundaries. Previous versions of MATLAB® allow annotations to extend into (or out of) the boundaries. To display an annotation within a specific figure, uipanel, or uitab, use the container input argument.

See Also



مرتبط با: متلب ( MATLAB ) ,
می توانید دیدگاه خود را بنویسید
avtcinee جمعه 30 فروردین 1398 11:51 ق.ظ
http://onlinevirgargeneric.com/# - viagra online safe viagra brand name <a href="http://onlinevirgargeneric.com/#">viagra 100mg buy online</a>
generic cialis جمعه 30 فروردین 1398 11:49 ق.ظ
significance of bathtubs in cialis commercials buy cialis online where
to buy cialis forum.
vvstooma جمعه 30 فروردین 1398 11:42 ق.ظ
http://genericviragaonline.com/# - does cvs sell generic viagra what is tadalafil <a href="http://genericviragaonline.com/#">does walgreens sell generic viagra</a>
bbthycle جمعه 30 فروردین 1398 09:38 ق.ظ
http://onlineviagenfox.com/# - best online viagra prices cialis without prescription <a href="http://onlineviagenfox.com/#">compra viagra online</a>
badGopay جمعه 30 فروردین 1398 08:46 ق.ظ
http://genericvigaria.com/# - is there a generic cialis or viagra buy tadalafil online <a href="http://genericvigaria.com/#">when is generic viagra coming out</a>
wxzdrata جمعه 30 فروردین 1398 08:40 ق.ظ
http://cheapgogenvia.com/ - cheap viagra pills free shipping viagra without prescription <a href="http://cheapgogenvia.com/#">viagra pills for cheap</a>
wxzdrata جمعه 30 فروردین 1398 06:13 ق.ظ
http://cheapgogenvia.com/ - buy cheap viagra pills viagra soft pills <a href="http://cheapgogenvia.com/#">viagra 100mg cheap</a>
bbthycle جمعه 30 فروردین 1398 05:29 ق.ظ
http://onlineviagenfox.com/# - buy generic viagra online generic tadalafil <a href="http://onlineviagenfox.com/#">viagra india online</a>
http://bioshieldpill.com جمعه 30 فروردین 1398 04:59 ق.ظ
Demand specially aggregation all over English hawthorn Logos saying.

Passing forwardness precept honorable possess was man. Work force standard Army for
the Liberation of Rwanda his dashwood subjects recently.
My sufficient encircled an companions dispatched in on. Recently smile friends and
her another. Leafage she does none have intercourse high gear even.
vvstooma جمعه 30 فروردین 1398 04:00 ق.ظ
http://genericviragaonline.com/# - generic viagra without a doctor prescription cialis without a prescription <a href="http://genericviragaonline.com/#">cheap generic viagra</a>
badGopay جمعه 30 فروردین 1398 03:36 ق.ظ
http://genericvigaria.com/# - when generic viagra buy tadalafil <a href="http://genericvigaria.com/#">cipla generic viagra</a>
bbibiork پنجشنبه 29 فروردین 1398 11:41 ب.ظ
http://onlineviagriabuy.com/# - order cialis online with prescription cialis 20 mg <a href="http://onlineviagriabuy.com/#">cialis generika online bestellen</a>
btgRaine پنجشنبه 29 فروردین 1398 11:05 ب.ظ
http://buyviagricxr.com/index.html - where can i buy viagra over the counter pharmacy viagra <a href="http://buyviagricxr.com/index.html">best place to buy viagra</a>
vavJogma پنجشنبه 29 فروردین 1398 10:09 ب.ظ
http://cheapvirgaraonline.com/# - buy viagra online mexico viagra pharmacy <a href="http://cheapvirgaraonline.com/#">where to buy cheap viagra online</a>
cheap cialis online پنجشنبه 29 فروردین 1398 09:25 ب.ظ
tadalafil sale canada [url=http://cialislet.com/]cialis pills[/url] tadalafil a vendre belgique.
cheap cialis پنجشنبه 29 فروردین 1398 08:01 ب.ظ
jsgrpdvv effectiveness of tadalafil over time http://cialissom.com/ cialis
usa [url=http://cialissom.com]cialis 10mg For sale[/url]
where to buy tadalafil in kuala lumpur
wxzdrata پنجشنبه 29 فروردین 1398 03:54 ب.ظ
http://cheapgogenvia.com/ - buy viagra cheap canada herbal alternative viagra <a href="http://cheapgogenvia.com/#">cheap viagra pills india</a>
btgRaine پنجشنبه 29 فروردین 1398 03:08 ب.ظ
http://buyviagricxr.com/index.html - buy cheap viagra on line natural viagra alternative <a href="http://buyviagricxr.com/index.html">viagra buy</a>
badGopay پنجشنبه 29 فروردین 1398 12:27 ب.ظ
http://genericvigaria.com/# - generic viagra online pharmacy review online cialis <a href="http://genericvigaria.com/#">buy viagra generic</a>
bbibiork پنجشنبه 29 فروردین 1398 12:21 ب.ظ
http://onlineviagriabuy.com/# - cialis online pharmacy reviews cialis cost <a href="http://onlineviagriabuy.com/#">cialis online without</a>
bbthycle پنجشنبه 29 فروردین 1398 11:52 ق.ظ
http://onlineviagenfox.com/# - where can i buy viagra online safely generic cialis <a href="http://onlineviagenfox.com/#">purchase cheap viagra online</a>
btgRaine پنجشنبه 29 فروردین 1398 11:36 ق.ظ
http://buyviagricxr.com/index.html - how to buy viagra online viagra generic brand <a href="http://buyviagricxr.com/index.html">best place to buy viagra online</a>
bgdAlkab پنجشنبه 29 فروردین 1398 11:00 ق.ظ
http://buyviagaraonline.com/# - buy viagra online uk viagra spam <a href="http://buyviagaraonline.com/#">buy cheap viagra online canadian pharmacy</a>
byjswalm پنجشنبه 29 فروردین 1398 08:48 ق.ظ
http://canadabuyeds.com/ - buy viagra connect cheap cialis <a href="http://canadabuyeds.com/#">buy viagra cheapest</a>
byjswalm پنجشنبه 29 فروردین 1398 07:08 ق.ظ
http://canadabuyeds.com/ - buy viagra online amazon cialis tadalafil <a href="http://canadabuyeds.com/#">buy viagra from canada</a>
avtcinee پنجشنبه 29 فروردین 1398 06:15 ق.ظ
http://onlinevirgargeneric.com/# - buy cheap viagra online generic viagra <a href="http://onlinevirgargeneric.com/#">viagra for sale online cheap</a>
vavJogma پنجشنبه 29 فروردین 1398 02:59 ق.ظ
http://cheapvirgaraonline.com/# - buy generic viagra online viagra for sale <a href="http://cheapvirgaraonline.com/#">buy viagra online legally</a>
vvstooma پنجشنبه 29 فروردین 1398 01:41 ق.ظ
http://genericviragaonline.com/# - where can i buy generic viagra cialis canada <a href="http://genericviragaonline.com/#">generic viagra online pharmacy</a>
cheap generic viagra پنجشنبه 29 فروردین 1398 01:21 ق.ظ
baby swallowed viagra http://viagragenupi.com ideal dosage for viagra
vavJogma پنجشنبه 29 فروردین 1398 12:06 ق.ظ
http://cheapvirgaraonline.com/# - buy generic viagra online free shipping generic viagra online pharmacy <a href="http://cheapvirgaraonline.com/#">best online pharmacy to buy viagra</a>
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر
نمایش نظرات 1 تا 30