matplotlib-users

 [Matplotlib-users] Matching 3D axes size to 2D in mixed subplot From: Jeff Berry - 2010-07-16 03:55:27 ```Hi, I'm using the new mixed axes feature in matplotlib 1.0.0 to combine 3D and 2D plots in a single figure. The problem is that the 3D axes have a lot of extra white space around them that prevents the plot to line up flush with the 2D plot. Here is an example image of this: using matplotlib: http://www.u.arizona.edu/~jjberry/matplotlib.png vs. matlab of the same thing: http://www.u.arizona.edu/~jjberry/matlab.png Is there any way of changing the space on the 3D axis to look more like the matlab figure? Thanks, Jeff Berry ```
 Re: [Matplotlib-users] Matching 3D axes size to 2D in mixed subplot From: Benjamin Root - 2010-07-18 18:17:51 Attachments: Message as HTML ```On Thu, Jul 15, 2010 at 9:13 PM, Jeff Berry wrote: > Hi, > > I'm using the new mixed axes feature in matplotlib 1.0.0 to combine 3D and > 2D plots in a single figure. The problem is that the 3D axes have a lot of > extra white space around them that prevents the plot to line up flush with > the 2D plot. Here is an example image of this: > > using matplotlib: http://www.u.arizona.edu/~jjberry/matplotlib.png; > > vs. matlab of the same thing: http://www.u.arizona.edu/~jjberry/matlab.png; > > Is there any way of changing the space on the 3D axis to look more like the > matlab figure? > > Thanks, > Jeff Berry > > > Jeff, thanks for pointing this out. An inadvertant side-effect of using add_subplot() for 3d axes seems to be that the creation process greatly restricts the available space for the 3d figure to be plotted. Whereas doing the old Axes3D() approach (albeit for non-subplots) would allow the 3D figure to use all the available space. I am currently examining this issue right now and might be tied to another bug that has been reported recently. Ben Root > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ```
 Re: [Matplotlib-users] Matching 3D axes size to 2D in mixed subplot From: Benjamin Root - 2010-08-11 18:58:26 Attachments: Message as HTML ```On Sun, Jul 18, 2010 at 1:17 PM, Benjamin Root wrote: > > > On Thu, Jul 15, 2010 at 9:13 PM, Jeff Berry wrote: > >> Hi, >> >> I'm using the new mixed axes feature in matplotlib 1.0.0 to combine 3D and >> 2D plots in a single figure. The problem is that the 3D axes have a lot of >> extra white space around them that prevents the plot to line up flush with >> the 2D plot. Here is an example image of this: >> >> using matplotlib: http://www.u.arizona.edu/~jjberry/matplotlib.png; >> >> vs. matlab of the same thing: >> http://www.u.arizona.edu/~jjberry/matlab.png; >> >> Is there any way of changing the space on the 3D axis to look more like >> the matlab figure? >> >> Thanks, >> Jeff Berry >> >> >> > Jeff, thanks for pointing this out. An inadvertant side-effect of using > add_subplot() for 3d axes seems to be that the creation process greatly > restricts the available space for the 3d figure to be plotted. Whereas > doing the old Axes3D() approach (albeit for non-subplots) would allow the 3D > figure to use all the available space. > > I am currently examining this issue right now and might be tied to another > bug that has been reported recently. > > Ben Root > Jeff, Sorry for taking so long to get back to you. I have found a sort of workaround that should help you out. You can use subplots_adjust(left=0.0, bottom=0.0, right=1.0, top=1.0), before creating the axes to specify that the axes objects should use all the space available to them. Note, this will still allow for a buffer between the graphs, which can be adjusted using wspace and hspace keywords. http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.subplots_adjust I hope that helps, Ben Root ```