1

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 ?

1 Answer 1

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()

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.