I wonder if there's the possibility to display several plots or images in a non-grid constellation ? For example is there a way to display a set of images in one figure in a circular constellation along the perimeter using Matplotlib or any other python package alike ?
Asked
Active
Viewed 378 times
1 Answers
1
An axes can be created and positionned via fig.add_axes([x,y,width,height])
see documentation. Also see What are the differences between add_axes and add_subplot?
In this case we can add the axes to positions lying on a circle, creating some kind of manual radial grid of axes.
import numpy as np
import matplotlib.pyplot as plt
N = 8
t = np.linspace(0,2*np.pi, N, endpoint=False)
r = 0.37
h = 0.9 - 2*r
w = h
X,Y = r*np.cos(t)-w/2.+ 0.5, r*np.sin(t)-h/2.+ 0.5
fig = plt.figure()
axes = []
for x,y in zip(X,Y):
axes.append(fig.add_axes([x, y, w, h]))
plt.show()

ImportanceOfBeingErnest
- 321,279
- 53
- 665
- 712