Can I arrange 3 identical subnet sizes in a triangular shape?

To make this clear, I will use a 4x4 grid to show where and how big I want to use my subtasks. The calculation is as follows:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 

I want the upper graph to be placed above 2, 3, 6 and 7. The two lower graphs are 9, 10, 13, 14 and 11, 12, 15, 16, respectively. In Matlab you can use a range of subtasks, but I believe that this only works for single-line configurations.

How can I do this in matplotlib? Do I need a Grid specialist? How will I use it then? There are not enough examples to understand how I should solve this problem.

+6
source share
1 answer

Use subplot with range:

 img = imread('cameraman.tif'); figure; subplot(4,4,[2 3 6 7]);imshow(img); subplot(4,4,[9 10 13 14]);imshow(img); subplot(4,4,[11 12 15 16]);imshow(img); 

And the result:


A matplotlib based on subplot2grid

 import matplotlib.pyplot as plt plt.subplot2grid( (4,4), [0,1], 2, 2 ) plt.plot( x1, y1 ) plt.subplot2grid( (4,4), [2,0], 2, 2 ) plt.plot( x2, y2 ) plt.subplot2grid( (4,4), [2,2], 2, 2 ) plt.plot( x2, y2 ) 

It gives the following result:

enter image description here

+14
source

Source: https://habr.com/ru/post/959153/


All Articles