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
The discussion revolves around the challenge of scaling the axes of an image in MATLAB to display specific arbitrary values instead of pixel dimensions. The user wants to adjust the x-axis to show a range from -3.85 to 3.85 and the y-axis from -2.9 to 2.9, but encounters issues with MATLAB interpreting the input as pixel values. The command "axis([XMIN XMAX YMIN YMAX])" is suggested to set the scaling for the axes, but the user reports that it only moves the image window without properly scaling it. Additionally, the function "imresize" is mentioned as a method to resize images, but it does not address the axis scaling issue directly. The conversation emphasizes the need for a solution that allows for arbitrary axis scaling while displaying the image correctly.
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