| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
gtext('string')
gtext({'string1','string2','string3',...})
gtext({'string1';'string2';'string3';...})
h = gtext(...)
gtext displays a text string in the current figure window after you select a location with the mouse.
gtext('string') waits for you to press a mouse button or keyboard key while the pointer is within a figure window. Pressing a mouse button or any key places 'string' on the plot at the selected location.
gtext({'string1','string2','string3',...}) places all strings with one click, each on a separate line.
gtext({'string1';'string2';'string3';...}) places one string per click, in the sequence specified.
h = gtext(...) returns the handle to a text graphics object that is placed on the plot at the location you select.
As you move the pointer into a figure window, the pointer becomes crosshairs to indicate that gtext is waiting for you to select a location. gtext uses the functions ginput and text.
Place a label on the current plot:
gtext('Note this divergence!')Annotating Plots for related functions
![]() | gt | guidata | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |