Create Cartesian axes - MATLAB axes (2024)

Create Cartesian axes

collapse all in page

Syntax

axes

axes(Name,Value)

axes(parent,Name,Value)

ax = axes(___)

axes(cax)

Description

axes creates the default Cartesian axesin the current figure and makes it the current axes. Typically, youdo not need to create axes before plotting since graphics functionsautomatically create axes when plotting if they do not exist.

example

axes(Name,Value) modifiesthe axes appearance or controls the way data displays using one ormore name-value pair arguments. For example, 'FontSize',14 setsthe font size for the axes text. For a list of properties, see Axes Properties.

example

axes(parent,Name,Value) creates the axes in the figure, panel, or tab specified by parent, instead of in the current figure.

ax = axes(___) returnsthe Axes object created. Use ax toquery and modify properties of the Axes object afterit is created. For a list of properties, see Axes Properties.

axes(cax) sets the CurrentAxes property of the parent figure to be cax. If the HandleVisibilty property of the parent figure is set to "on", then cax also becomes the current axes. This command also makes cax the first object listed in the Children property of the parent object. The parent object is typically a figure or a tiled chart layout.

Examples

collapse all

Position Multiple Axes in Figure

Position two Axes objects in a figure and add a plot to each one.

Specify the position of the first Axes object so that it has a lower left corner at the point (0.1 0.1) with a width and height of 0.7. Specify the position of the second Axes object so that it has a lower left corner at the point (0.65 0.65) with a width and height of 0.28. By default, the values are normalized to the figure. Return the Axes objects as ax1 and ax2.

figureax1 = axes('Position',[0.1 0.1 0.7 0.7]);ax2 = axes('Position',[0.65 0.65 0.28 0.28]);

Create Cartesian axes - MATLAB axes (1)

Add a plot to each Axes object. Specify the axes by passing it as the first input argument to the graphics function. Most graphics functions reset some axes properties, such as the tick values and labels. However, they do not reset the axes position.

contour(ax1,peaks(20))surf(ax2,peaks(20))

Create Cartesian axes - MATLAB axes (2)

Make Axes the Current Axes

Open Live Script

Create two overlayed Axes objects. Then, specify the current axes and add a plot.

First create two Axes objects and specify the positions. Display the box outline around each axes. Return the Axes objects as ax1 and ax2.

figureax1 = axes('Position',[0.1 0.1 .6 .6],'Box','on');ax2 = axes('Position',[.35 .35 .6 .6],'Box','on');

Create Cartesian axes - MATLAB axes (3)

Make ax1 the current axes. This action brings the axes to the front of the display and makes it the target for subsequent graphics functions. Add a line plot to the axes.

axes(ax1)x = linspace(0,10);y = sin(x);plot(x,y)

Create Cartesian axes - MATLAB axes (4)

Create Axes in Tabs

Open Live Script

Create a figure with two tabs. Add axes to each tab by specifying the parent container for each one. Plot a line in the first tab and a surface in the second tab.

figuretab1 = uitab('Title','Tab1');ax1 = axes(tab1);plot(ax1,1:10)tab2 = uitab('Title','Tab2');ax2 = axes(tab2);surf(ax2,peaks)

Create Cartesian axes - MATLAB axes (5)

Input Arguments

collapse all

parentParent container
Figure object | Panel object | Tab object | TiledChartLayout object | GridLayout object

Parent container, specified as a Figure, Panel, Tab, TiledChartLayout, or GridLayout object.

caxAxes to make current
Axes object | PolarAxes object | GeographicAxes object | standalone visualization

Axes to make current, specified as an Axes object, a PolarAxes object, a GeographicAxes object, or a standalone visualization such as a heatmap.

If you want to make an object the current axes without changing the state of the figure, set the CurrentAxes property of the figure containing that object; for example:

fig = gcf;fig.CurrentAxes = cax;

This approach is useful if you want a figure to remain minimized or stacked below other figures, but want to specify the current axes.

Name-Value Arguments

Example: axes('Position',[.3 .3 .5 .5]) setsthe position.

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

Some graphics functions change axes property values when plotting,such as the axis limits or tick values. Set axes properties afterplotting.

Note

The properties listed here are only a subset. For a full list,see Axes Properties.

More About

collapse all

Current Axes

The current axes is the default target object for many graphics commands, such as plot, title, and xlim. The following types of objects can become the current axes. Typically, it is the last one of these objects that is created, clicked on, or plotted into.

  • An Axes object.

  • A PolarAxes object.

  • A GeographicAxes object.

  • A standalone visualization, which is a chart designed for a special purpose that works independently from other charts. For example, a heatmap is a standalone visualization for observing the interaction between two variables in tabular data.

The gca command returns the current axes, and the CurrentAxes property of a figure stores its current axes. Thus, if you change the current figure, the current axes also changes.

Version History

Introduced before R2006a

See Also

Properties

  • Axes Properties

Functions

  • axis | cla | gca | figure | clf | tiledlayout | nexttile | polaraxes

Topics

  • Control Ratio of Axis Lengths and Data Unit Lengths
  • Control Axes Layout

MATLAB Command

You clicked a link that corresponds to this MATLAB command:

 

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Create Cartesian axes - MATLAB axes (6)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本 (日本語)
  • 한국 (한국어)

Contact your local office

Create Cartesian axes - MATLAB axes (2024)

References

Top Articles
Honda Civic IX (2011-2015) fuse box diagrams & schemes
Fuse Box Diagram Honda Accord (2013-2017)
Funny Roblox Id Codes 2023
Www.mytotalrewards/Rtx
San Angelo, Texas: eine Oase für Kunstliebhaber
Golden Abyss - Chapter 5 - Lunar_Angel
Www.paystubportal.com/7-11 Login
Steamy Afternoon With Handsome Fernando
fltimes.com | Finger Lakes Times
Detroit Lions 50 50
18443168434
Newgate Honda
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
978-0137606801
Nwi Arrests Lake County
Missed Connections Dayton Ohio
Justified Official Series Trailer
London Ups Store
Committees Of Correspondence | Encyclopedia.com
Jinx Chapter 24: Release Date, Spoilers & Where To Read - OtakuKart
How Much You Should Be Tipping For Beauty Services - American Beauty Institute
How to Create Your Very Own Crossword Puzzle
Apply for a credit card
Unforeseen Drama: The Tower of Terror’s Mysterious Closure at Walt Disney World
Ups Print Store Near Me
How Taraswrld Leaks Exposed the Dark Side of TikTok Fame
University Of Michigan Paging System
Dashboard Unt
Access a Shared Resource | Computing for Arts + Sciences
2023 Ford Bronco Raptor for sale - Dallas, TX - craigslist
Speechwire Login
Healthy Kaiserpermanente Org Sign On
Restored Republic
Progressbook Newark
Lawrence Ks Police Scanner
3473372961
Landing Page Winn Dixie
Everstart Jump Starter Manual Pdf
Hypixel Skyblock Dyes
Senior Houses For Sale Near Me
Flashscore.com Live Football Scores Livescore
Ksu Sturgis Library
Trivago Myrtle Beach Hotels
Thotsbook Com
Funkin' on the Heights
Caesars Rewards Loyalty Program Review [Previously Total Rewards]
Marcel Boom X
Www Pig11 Net
Ty Glass Sentenced
Game Akin To Bingo Nyt
Ranking 134 college football teams after Week 1, from Georgia to Temple
Latest Posts
Article information

Author: Jerrold Considine

Last Updated:

Views: 6101

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.