Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In examples below we assume

Code Block
axsaaxes = fig.add_subplot(111)
axim = axsaaxes.imshow(arrwin, interpolation='nearest', origin='bottom', aspect='auto', extent=range)

How to draw axis without labels

Code Block
import matplotlib.ticker as mtick
axsaaxes.xaxis.set_major_formatter( mtick.NullFormatter() )

How to rotate axis labels

Code Block
        for label in axsbaxes.get_xticklabels() :
            label.set_rotation(60)                  # rotate by 60 degree
            label.set_horizontalalignment('center') # 'right', etc.

or use method:

Code Block

def rotate_lables_for_xaxis(axes, angle=60, alignment='center') :
    for label in axes.get_xticklabels() :
        label.set_rotation(angle)
        label.set_horizontalalignment(alignment)

How to change axis label position on the plot

Code Block
        axsbaxes.xaxis.set_ticks_position('top')
        axsbaxes.yaxis.set_ticks_position('right')

...