0

I need to break a plot into four subplots. Consider the following code:

import numpy as np
import matplotlib.pyplot as plt

MM= [[0, 1], [1, 0], [14, 15], [15, 14], [67, 68], [68, 67], [72, 
73], [73, 72], [85, 86], [86, 85], [132, 133], [133, 132], [169, 170], [170, 
169], [184, 185], [185, 184], [196, 197], [197, 196], [242, 243], [243, 242],
[269, 270], [270, 269], [274, 275], [275, 274], [297, 298], [298, 297], [341,
342], [342, 341], [378, 379], [379, 378], [387, 388], [388, 387], [390, 391],
[391, 390], [443, 444], [444, 443], [490, 491], [491, 490], [501, 502], [502, 
501], [527, 528], [528, 527], [550, 551], [551, 550], [556, 557], [557, 556],
[583, 584], [584, 585], [584, 583], [585, 584], [594, 595], [595, 594], [601,
602], [602, 601], [711, 712], [712, 711]]

x,y = zip(*MM)

plt.scatter(x,y, s=0.8, c='purple', alpha=1)

plt.axhline(576, linewidth=0.3, color='blue', label='zorder=2', zorder=2)
plt.axvline(576, linewidth=0.3, color='blue', label='zorder=2', zorder=2)

plt.xlim(0, 820)
plt.ylim(0, 820)

plt.show()

The code produces this plot. I need to break this plot into four subplots exactly at purple lines inside the plot. I want to maintain xticks and yticks intervals. The new plot is something like this plot. I need to split a given plot into subplots but not adding subplots to a figure like the one in Matplotlib different size subplots. Anyone has any idea?

sara
  • 23
  • 1
  • 5
  • Please use the integrated image uploader and don't post bmp images. – ImportanceOfBeingErnest Oct 10 '17 at 20:50
  • The question and answers you mentioned, don't meet my needs. I asked different question!!!!!! I need to split a given plot into subplots but not adding subplots to a figure! – sara Oct 10 '17 at 21:48
  • You need to create 4 subplots with unequal size to achieve what you call "split". This is shown in the duplicate question. If questions/answers don't help, the question needs to clearly state in how far they don't. This is the first point of [ask]. – ImportanceOfBeingErnest Oct 10 '17 at 21:51
  • In that question we need to specify the size but I want the size to be specified automatically, because subplots in my question share x or y axis with each other and I need it for bulk download. I can't specify sizes of at least 200 plots. I also can't use integrated image uploader for not having enough reputation – sara Oct 10 '17 at 21:54
  • You need to create 4 subplots with width/height ratio `[576, 820-576]`. This is not about what you want, this is about how to achieve your goal. Of course those numbers can be taken from variables in a loop to create 200 figures afterwards. – ImportanceOfBeingErnest Oct 10 '17 at 21:58
  • The first subplot has width/height ratio of [576, 820-576], the next one [820-576, 820-576] , the third one [576, 576] and the fourth one[820-576, 576]. – sara Oct 10 '17 at 22:02
  • Did you even bother reading and understanding the solution to the duplicate question? – ImportanceOfBeingErnest Oct 10 '17 at 22:18

0 Answers0