Autoscaling Imagesc Plot And Imshow Plots


title: “Autoscaling imagesc() plot and imshow() plots” excerpt: Get axes ratioed correctly in Matplotlib, Matlab and Octave with these commands. categories:

  • matlab
  • matplotlib tags:
  • gnu-octave

GNU Octave has default axis scaling that scales x and y axes proportionally to the axes values. So if one axis values span a much wider range than the other axis, the smaller span axis gets very thin. You can simply insert the line

axis('normal') 

after imagesc()

In Matplotlib, the same issue occurs, which can be overcome with

aspect='auto'

Updated: