MATLAB How can I change the x and y-axis limits in Matlab to arbitrary scales?

  • Thread starter Thread starter Kidphysics
  • Start date Start date
  • Tags Tags
    Axis Matlab
Click For Summary
SUMMARY

The discussion focuses on changing the x and y-axis limits in MATLAB to arbitrary scales for image display. Users encountered issues with the axis limits defaulting to pixel sizes instead of the desired values. The correct command to set the axis limits is axis([XMIN XMAX YMIN YMAX]), but some users reported that this did not scale the image as expected. The function B = imresize(A, scale) is also mentioned for resizing images, but it does not directly address axis scaling.

PREREQUISITES
  • Familiarity with MATLAB's plotting functions
  • Understanding of image dimensions and scaling
  • Knowledge of the axis command in MATLAB
  • Basic experience with image processing in MATLAB
NEXT STEPS
  • Research the axis command in MATLAB for detailed usage
  • Explore the imresize function for image scaling techniques
  • Learn about MATLAB's property editor for figure customization
  • Investigate additional image processing functions in MATLAB
USEFUL FOR

This discussion is beneficial for MATLAB users, particularly those involved in image processing and visualization, including data scientists, engineers, and researchers looking to customize plot axes effectively.

Kidphysics
Messages
164
Reaction score
0
Hello, I have an image which gets displayed and has the x and y-axis ranging from 0-812 and 0-607 respectively. This is because these are the pixel sizes for my image. I would like to change the x-axis to show -3.85, 3.85 and for the y-axis to show -2.9,2.9. However, when I load my image into the figure and go into the property editor Matlab believes I am typing in the range of pixels still. I would just like to scale my image with these arbitrary scales. Please help!
 
Physics news on Phys.org
axis([XMIN XMAX YMIN YMAX]) sets scaling for the x- and y-axes on the current plot.

Type 'help axis' or 'doc axis' for more info.
 
kreil said:
axis([XMIN XMAX YMIN YMAX]) sets scaling for the x- and y-axes on the current plot.

Type 'help axis' or 'doc axis' for more info.

this gave me the same problem. it did not scale the image it simple moved the image window to this location.
 
B = imresize(A, scale) returns image B that is scale times the size of A.
 

Similar threads

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