<div dir="ltr"><div>I don't think I understand your problem fully, but a GridSpec sounds like it'll fit the bill. We have a tutorial on it at our website. You'll probably get the most mileage out of the width_ratios and height_ratios parameters:</div><div><a href="https://matplotlib.org/tutorials/intermediate/gridspec.html">https://matplotlib.org/tutorials/intermediate/gridspec.html</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 19, 2019 at 12:02 PM Bruno Pagani <<a href="mailto:bruno.pagani@astrophysics.eu">bruno.pagani@astrophysics.eu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi there,<br>
<br>
I’m trying to combine three graphs into one, but with some specific<br>
constraints on the layout. The three graphs are having the same x and y<br>
variables, but not over the same span. Each graph size should reflects<br>
that (e.g. if a change of 1 on the x axis is 1 cm on one graph, so<br>
should it be for the other ones). Also, I’d like the y label and ticks<br>
labels to be shared amongst the three graphs. Same goes for the colorbar<br>
(those are scatter plots) and the legend.<br>
<br>
Attached are the three figures (.pdf), and what the combined version<br>
should look like (target.png, but here it was obtained by removing parts<br>
by hand and stretching everything to fit).<br>
<br>
Below is some minimal code to produce three similarly looking graphs, if<br>
someone has an idea (GridSpec?) for this, I should be able to adapt it<br>
to my actual code:<br>
<br>
import matplotlib.pyplot as plt<br>
import numpy as np<br>
<br>
plt.scatter(np.repeat(np.linspace(0,3.5,15)[:,None],11,axis=1),np.repeat(np.linspace(0,0.5,11)[None,:],15,axis=0),c=np.random.random((15,11)),label="Some<br>
label")<br>
<br>
plt.scatter(np.repeat(np.linspace(0,6,25)[:,None],11,axis=1),np.repeat(np.linspace(0,0.5,11)[None,:],25,axis=0),c=np.random.random((25,11)),marker='*',label="Some<br>
other label")<br>
<br>
plt.scatter(np.repeat(np.linspace(0,11,23)[:,None],11,axis=1),np.repeat(np.linspace(0,0.5,11)[None,:],23,axis=0),c=np.random.random((23,11)),marker='D',label="Yet<br>
another label")<br>
<br>
Regards,<br>
Bruno<br>
<br>
_______________________________________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-users</a><br>
</blockquote></div>