w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
make only left subplots and bottom subplots (in MxN panels) contain x and y axis labels

The best solution is probably pyplot.subplots(). You can do like:

fig, axes = pyplot.subplots(nrows=3, ncols=4, sharex=True,
sharey=True)

enter image
description here

and then only the left and bottom axes will have the labels displayed.

To access each subplot you can get it from axes like you do in a matrix: ax = axes[i,j]

To control the tick positions you can use:

ax.xaxis.set_tick_position('bottom')
ax.yaxis.set_tick_position('left')

To set an axis label you can do:

ax.set_label_text('Something')




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.