Is it possible to truncate axes in matplotlib?

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

···

2013/5/24 ChaoYue [via matplotlib] <[hidden email]>

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]> 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

truncated_plot.py (11K) Download Attachment


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]
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)

2013/5/24 ChaoYue [via matplotlib] <[hidden email]>

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)