Defining Axes in Matlab plotting

  • Context: MATLAB 
  • Thread starter Thread starter adnan jahan
  • Start date Start date
  • Tags Tags
    Axes Matlab Plotting
Click For Summary
SUMMARY

The discussion focuses on defining axes in MATLAB plotting, specifically setting the vertical axis limits for a plot. The user initially defines the horizontal axis with the command x=0:0.2:1.2; and seeks to limit the vertical axis to a range of -5 to +1. The solution provided includes using the axis command with the syntax axis([xmin xmax ymin ymax]) to set the desired limits. It is emphasized that the function u must be defined prior to plotting for the axis limits to take effect.

PREREQUISITES
  • Familiarity with MATLAB syntax and commands
  • Understanding of plotting functions in MATLAB
  • Knowledge of defining functions in MATLAB
  • Basic concepts of axis manipulation in MATLAB
NEXT STEPS
  • Learn how to define functions in MATLAB for plotting
  • Research the axis command in MATLAB for advanced axis manipulation
  • Explore MATLAB's plot function options for customizing plots
  • Investigate MATLAB's documentation on graphical properties for better visualization
USEFUL FOR

MATLAB users, data analysts, and engineers who are involved in data visualization and require precise control over plot axes.

adnan jahan
Messages
93
Reaction score
0
Dear Fellows,

I am plotting in matlab, and defined and axis along horizontal in such a way
x=0:0.2:1.2;
for
plot (x, u,'re--' )
but I need to define the limitation of u along vertical axis,,,,


can anyone suggest me the exact for range -5 to +1

Regards
 
Physics news on Phys.org
well, you need to define u first, have you done that? I told you how to explicitly define the axes themselves in the other other thread where you asked this question, but if you're just looking at defining the ranges you can use the axis command:

axis([xmin xmax ymin ymax])

if you don't want to change the x limits, it's:

axis([xlim ymin ymax])
 
I have define the function u,
x=0:0.2:1.2;
axis([xlim 0 100])
plot (x, u,'re--' )
does not give any limitation of y axis,,,, all values are same as the one got without axis([xlim 0 100])
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K