|
From: ChaoYue <cha...@gm...> - 2013-05-25 12:22:24
|
Hi Mat, Just one words, the plt.xxxx functions probably normally pick the last active axes to act on. many of these functions are methods of axes object, you can call directly from there. Chao On Sat, May 25, 2013 at 1:14 PM, mat [via matplotlib] < ml-...@n5...> wrote: > Perfect!! Many thanks! > > > 2013/5/25 ChaoYue [via matplotlib] <[hidden email]<http://user/SendEmail.jtp?type=node&node=41131&i=0> > > > >> Is this what you want? >> >> I change a bit of the code and put some example data there. >> >> >> fig,axs = plt.subplots(nrows=2, ncols = 2, figsize = (6, 6) ) >> >> >> plt.subplots_adjust( left = 0.0505, right = 0.96, bottom = 0.05, top = >> 0.95 , wspace = 0.07, hspace = 0.12) >> >> left_ax, right_ax = >> Axes_Replace_Split_Axes(fig,axs[1,1],split_fraction=[0.48,0.02,0.50],direction='h') >> >> Axes_Set_Breakaxis(left_ax, right_ax, 0.03,0.02,'h') >> >> #left_ax.set_xlim(-0.05, 0.29) >> >> #left_ax.set_xticks (np.arange (0, 0.3, 0.1)) >> >> #right_ax.set_xticks (np.arange (0.7, 1.05, 0.1)) >> >> #right_ax.set_xlim(0.71, 1) >> >> left_ax.plot(np.arange(10),'ro') >> right_ax.plot(np.arange(10),'ro') >> left_ax.set_xlim(0,10) >> right_ax.set_xlim(0,10) >> left_ax.set_ylim(0,15) >> right_ax.set_ylim(0,40) >> >> cheers, >> >> Chao >> >> On Sat, May 25, 2013 at 11:54 AM, mat [via matplotlib] <[hidden email]<http://user/SendEmail.jtp?type=node&node=41130&i=0> >> > wrote: >> >>> Great! >>> >>> The code is almost finished: >>> >>> fig,axs = plt.subplots(nrows=2, ncols = 2, figsize = (11, 10) ) >>> >>> plt.subplots_adjust( left = 0.0505, right = 0.96, bottom = 0.05, top = >>> 0.95 , wspace = 0.07, hspace = 0.12) >>> >>> left_ax, right_ax = >>> Axes_Replace_Split_Axes(fig,axs[1,1],split_fraction=[0.48,0.02,0.50],direction='h') >>> >>> Axes_Set_Breakaxis(left_ax, right_ax, 0.03,0.02,'h') >>> >>> left_ax.set_xlim(-0.05, 0.29) >>> >>> left_ax.set_xticks (np.arange (0, 0.3, 0.1)) >>> >>> right_ax.set_xticks (np.arange (0.7, 1.05, 0.1)) >>> >>> right_ax.set_xlim(0.71, 1) >>> >>> >>> >>> >>> >>> All what I need now is to manipulate the ylim of the truncated subplot >>> (independently for the left and right y axes). plt.ylim(300, 500) only >>> modifies the right yaxis of the truncated plot, not the left one. Is it >>> possible to modify the left y axis of the truncated plot? >>> >>> >>> >>> >>> >>> >>> 2013/5/24 ChaoYue [via matplotlib] <[hidden email]<http://user/SendEmail.jtp?type=node&node=41129&i=0> >>> > >>> >>>> Hi Mat, >>>> >>>> >>>> so you have two points in the TODO: >>>> #TODO: #plot something on the left side of suplot 2 --> >>>> plt.plot(xx,yy, marker = 'o', color = 'k') does not work >>>> #change the y axis of suplot 2, on the right and on the left >>>> side >>>> >>>> the first one, is this what you want? >>>> left_ax.plot(xx,yy, marker = 'o', color = 'k') >>>> >>>> the second one, I don't get well, are you meaning something like: >>>> left_ax.set_ylim(....)? >>>> >>>> cheers, >>>> >>>> Chao >>>> >>>> On Fri, May 24, 2013 at 2:36 PM, mat [via matplotlib] <[hidden email]<http://user/SendEmail.jtp?type=node&node=41124&i=0> >>>> > wrote: >>>> >>>>> Hi Chao, >>>>> >>>>> Please find attached the script which includes your 3 functions, and a >>>>> plot that I've just made. The things I can't manage to do are listed in the >>>>> TODO section (end of the script) >>>>> >>>>> >>>>> Cheers, >>>>> Mat >>>>> >>>>> >>>>> >>>>> >>>>> 2013/5/24 ChaoYue [via matplotlib] <[hidden email]<http://user/SendEmail.jtp?type=node&node=41123&i=0> >>>>> > >>>>> >>>>> Hi, could you send an attachment to show what you've achieved so far? >>>>>> >>>>>> Chao >>>>>> >>>>>> ------------------------------ >>>>>> If you reply to this email, your message will be added to the >>>>>> discussion below: >>>>>> >>>>>> http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092p41122.html >>>>>> To unsubscribe from Is it possible to truncate axes in matplotlib?, click >>>>>> here. >>>>>> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >>>>>> >>>>> >>>>> >>>>> *truncated_plot.py* (11K) Download Attachment<http://matplotlib.1069221.n5.nabble.com/attachment/41123/0/truncated_plot.py> >>>>> >>>>> >>>>> ------------------------------ >>>>> If you reply to this email, your message will be added to the >>>>> discussion below: >>>>> >>>>> http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092p41123.html >>>>> To start a new topic under matplotlib - users, email [hidden email]<http://user/SendEmail.jtp?type=node&node=41124&i=1> >>>>> To unsubscribe from matplotlib, click here. >>>>> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> *********************************************************************************** >>>> Chao YUE >>>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) >>>> UMR 1572 CEA-CNRS-UVSQ >>>> Batiment 712 - Pe 119 >>>> 91191 GIF Sur YVETTE Cedex >>>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 >>>> >>>> ************************************************************************************ >>>> >>>> >>>> ------------------------------ >>>> If you reply to this email, your message will be added to the >>>> discussion below: >>>> >>>> http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092p41124.html >>>> To unsubscribe from Is it possible to truncate axes in matplotlib?, click >>>> here. >>>> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >>>> >>> >>> >>> >>> ------------------------------ >>> If you reply to this email, your message will be added to the >>> discussion below: >>> >>> http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092p41129.html >>> To start a new topic under matplotlib - users, email [hidden email]<http://user/SendEmail.jtp?type=node&node=41130&i=1> >>> To unsubscribe from matplotlib, click here. >>> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >>> >> >> >> >> -- >> >> *********************************************************************************** >> Chao YUE >> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) >> UMR 1572 CEA-CNRS-UVSQ >> Batiment 712 - Pe 119 >> 91191 GIF Sur YVETTE Cedex >> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 >> >> ************************************************************************************ >> >> >> ------------------------------ >> If you reply to this email, your message will be added to the >> discussion below: >> >> http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092p41130.html >> To unsubscribe from Is it possible to truncate axes in matplotlib?, click >> here. >> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >> > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092p41131.html > To start a new topic under matplotlib - users, email > ml-...@n5... > To unsubscribe from matplotlib, click here<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx> > . > NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092p41132.html Sent from the matplotlib - users mailing list archive at Nabble.com. |