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

  • Context: MATLAB 
  • Thread starter Thread starter Kidphysics
  • Start date Start date
  • Tags Tags
    Axis Matlab
Click For Summary

Discussion Overview

The discussion revolves around changing the x and y-axis limits in Matlab to arbitrary scales for an image display. Participants explore methods to achieve this scaling while addressing issues related to pixel dimensions and the behavior of Matlab's axis settings.

Discussion Character

  • Technical explanation, Debate/contested, Conceptual clarification

Main Points Raised

  • One participant seeks assistance in changing the x-axis and y-axis limits from pixel dimensions to arbitrary values (-3.85 to 3.85 for x and -2.9 to 2.9 for y).
  • Another participant suggests using the command axis([XMIN XMAX YMIN YMAX]) to set the axis limits.
  • A subsequent reply indicates that using the axis command did not achieve the desired scaling, as it merely repositioned the image without changing its scale.
  • Another participant introduces the imresize function, which scales the image size but does not directly address the axis limits issue.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on how to effectively change the axis limits to arbitrary scales, with some methods proposed leading to different outcomes.

Contextual Notes

There is uncertainty regarding the effectiveness of the axis command in scaling the image as intended, and the relationship between image size and axis limits remains unresolved.

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 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K