[Matplotlib-users] I cannot change the axis tick separation or nbins in Axis artist
Hi, I am working on a plot that requires AxisArtist and I cannot set the tick separation (or nbins) that I want to avoid overlapping of ticklabels. I read http://www.ce.mu.edu.tr/sharedoc/python-matplotlib-doc-1.0.1/html/mpl_toolkits/axes_grid/users/axisartist.html#gridhelper, where they suggest to use the classical set_ticks, but it doesn't work. ax.xaxis.set_ticks() does not makes any difference, the ticks are same as originally, and ax.axis[left].set_ticks() results in an error: 'AxisArtist' object has no attribute 'set_ticks' Can somebody help me? Thanks in advance, Patricia -- View this message in context: http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] I cannot change the axis tick separation or nbins in Axis artist
Does xticks not do what you want? Maybe I am misundertsanding because you are trying to do something with a raw Artist... http://matplotlib.org/api/pyplot_api.html?highlight=xticks#matplotlib.pyplot.xticks Cheers, Jody On Feb 20, 2013, at 10:31 AM, patricia ptramba...@hotmail.com wrote: Hi, I am working on a plot that requires AxisArtist and I cannot set the tick separation (or nbins) that I want to avoid overlapping of ticklabels. I read http://www.ce.mu.edu.tr/sharedoc/python-matplotlib-doc-1.0.1/html/mpl_toolkits/axes_grid/users/axisartist.html#gridhelper, where they suggest to use the classical set_ticks, but it doesn't work. ax.xaxis.set_ticks() does not makes any difference, the ticks are same as originally, and ax.axis[left].set_ticks() results in an error: 'AxisArtist' object has no attribute 'set_ticks' Can somebody help me? Thanks in advance, Patricia -- View this message in context: http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Jody Klymak http://web.uvic.ca/~jklymak/ -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] I cannot change the axis tick separation or nbins in Axis artist
Dear Jody, No, I tried it also... ax.axis[left].xticks() results in error: 'AxisArtist' object has no attribute 'xticks' ax.xticks() results in error: 'Floating AxesHostAxesSubplot' object has no attribute 'xticks' plt.xticks() or just xticks() does not produce any change. Any idea? http://www.ce.mu.edu.tr/sharedoc/python-matplotlib-doc-.0.1/html/mpl_toolkits/axes_grid/users/axisartist.html#gridhelper gives some explanation with the The GridHelperRectlinear, but I cannot make it work Thanks, Patricia -- View this message in context: http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446p40448.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] cross correlation
Thank you very much Smith and Paul, I was away from office due to a medical situation. So could not respond and thank you regarding the help. I have got the results now and the tips from both of you were extremely useful. I am facing an issue with the code when I call plt.xcorr, in a loop. it builds up usage of memory by python and reaches to the RAM what ever available ( in my 4 GB laptop it reaches almost full and in my 24 GB desktop it reaches the available. I suspected the plot not being closed during each iteration so have given a plt.close('all') in the loop. after which it is taking a good time to run the code which was otherwise faster until ram usage reaches its maximum. Is there a way to get out of this situation?. I am attaching the code here and also the link to the data I am using. If possible kindly help. ftp ftpser.incois.gov.in user temp password incoistemp cd /home0/temp/comp bin mget qu_test.nc.gz gunzip qu_test.nc.gz *** Sudheer Joseph Indian National Centre for Ocean Information Services Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com Web- http://oppamthadathil.tripod.com *** From: Sterling Smith smit...@fusion.gat.com To: Sudheer Joseph sudheer.jos...@yahoo.com Cc: Paul Hobson pmhob...@gmail.com; matplotlib-users@lists.sourceforge.net matplotlib-users@lists.sourceforge.net Sent: Friday, 8 February 2013 10:23 PM Subject: Re: [Matplotlib-users] cross correlation Sudheer, For the documentation you are looking for print ax1.xcorr.__doc__ (Paul tried to give you the IPython method of getting that documentation which is by typing a ? (or ??) after the desired object.) In the documentation (at the link you gave http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.xcorr), it says that there are three objects returned by xcorr: Return value is a tuple (*lags*, *c*, *line*) where: - *lags* are a length ``2*maxlags+1`` lag vector - *c* is the ``2*maxlags+1`` auto correlation vector - *line* is a :class:`~matplotlib.lines.Line2D` instance returned by :func:`~matplotlib.pyplot.plot`. So the error you were getting is due to the fact that you have only specified two variables to hold the three returned objects. Try: lags,c,line = ax1.xcorr . (Note that you have xcorr and lags backwards in your attempt.) -Sterling On Feb 8, 2013, at 1:56AM, Sudheer Joseph wrote: Thank you verymuch Hobson, However I think I did not understand the suggestion by you fully( pardon my ignorance). I use the below test code from matplotlib site. How does one make a call to get lags and correlation corresponding to the x and y values in the plot. a Print command of In [23]: print ax1.xcorr bound method AxesSubplot.xcorr of matplotlib.axes.AxesSubplot object at 0x44c1410 results as above. Is it possible to assign the xcorr,lags=ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2) ? with a different syntax? I get below error when I try the above . In [27]: xcorr,lags=ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2) --- ValueError Traceback (most recent call last) /home/sjo/work/PY_WORK/stats/ipython-input-27-e1e58c045ad4 in module() 1 xcorr,lags=ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2) ValueError: too many values to unpack import matplotlib.pyplot as plt import numpy as np x,y = np.random.randn(2,100) fig = plt.figure() ax1 = fig.add_subplot(211) ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2) ax1.grid(True) ax1.axhline(0, color='black', lw=2) ax2 = fig.add_subplot(212, sharex=ax1) ax2.acorr(x, usevlines=True, normed=True, maxlags=50, lw=2) ax2.grid(True) ax2.axhline(0, color='black', lw=2) plt.show() From: Paul Hobson pmhob...@gmail.com To: Sudheer Joseph sudheer.jos...@yahoo.com Cc: matplotlib-users@lists.sourceforge.net matplotlib-users@lists.sourceforge.net Sent: Thursday, 7 February 2013 10:31 PM Subject: Re: [Matplotlib-users] cross correlation On Thu, Feb 7, 2013 at 3:24 AM, Sudheer Joseph sudheer.jos...@yahoo.com wrote: Dear Users, I am relatively new to Matplotlib. I wanted to find cross correlation between 2 time series for my research and was looking at options available with python and found http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.xcorr . However I wanted to save the results in a netcdf file for further use. ie
[Matplotlib-users] PGF/Tikz backend and Rasterize
I'm using the recently added PGF/Tikz support to save figures as .pgf commands to include in a Latex document (I love this new feature!). The final rendered figures look great after running through pdflatex, but occasionally it's impractical to use pure vector drawing instructions. For example, I'm currently working on a figure with 6 subplots, each containing a scatter type plot with ~400k markers. The resulting .pgf file is ~350MB. Is it possible to rasterize the individual axes plots (to .png say) and then generate a 'hybrid' .pgf output where things like axes ticks, labels, etc are still vectorized, but the excessively dense scatter plot are treated as imshow plots are and imported a raster images? I've tried setting 'rasterized' = True on both the axes and the plot command, but no dice. Sample code: p = np.random.randn(40,4)# of course I have actual data, but this should produce the same problem when saving count = 0 for i in xrange(4): for j in xrange(i+1,4): count += 1 ax = fig.add_subplot(2,3, count, rasterized=True) ax.plot(p[:,i], p[:,j], 'k.', markersize=0.25, rasterized=True) Any advice or insight would be greatly appreciated. Thanks -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] I cannot change the axis tick separation or nbins in Axis artist
Perhaps you could include some code that illustrates what you are trying to do? I'm confused if you are trying to do something simple and are just going about it the wrong way, or if you are doing something hard. If I do ax=axes() ax.plot(arange(1.,10.)) xticks(range(0,10,2)) yticks(range(0,10,2)) I get ticks every 2 points. Thanks, Jody On Feb 20, 2013, at 11:34 AM, patricia ptramba...@hotmail.com wrote: Dear Jody, No, I tried it also... ax.axis[left].xticks() results in error: 'AxisArtist' object has no attribute 'xticks' ax.xticks() results in error: 'Floating AxesHostAxesSubplot' object has no attribute 'xticks' plt.xticks() or just xticks() does not produce any change. Any idea? http://www.ce.mu.edu.tr/sharedoc/python-matplotlib-doc-.0.1/html/mpl_toolkits/axes_grid/users/axisartist.html#gridhelper gives some explanation with the The GridHelperRectlinear, but I cannot make it work Thanks, Patricia -- View this message in context: http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446p40448.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Jody Klymak http://web.uvic.ca/~jklymak/ -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Multiple XY plots
Hi, could you use a loop to solve it? arr1list = [np.arange(10) + i for i in range(10)] arr2list = [np.arange(10) -i for i in range(10)] for arr1,arr2 in zip(arr1list,arr2list): plot(arr1,arr2) you can use a more object oriented way: fig = plt.figure() ax = fig.add_subplot() for arr1,arr2 in zip(arr1list,arr2list): ax.plot(arr1,arr2) code not tested. cheers, Chao On Thu, Feb 21, 2013 at 4:17 AM, lkz2366 [via matplotlib] ml-node+s1069221n40451...@n5.nabble.com wrote: I am confused on how to plot a variable number of XY plots on a single chart. I want to superimpose XY plots on a single chart but the number of plots is unknown until runtime. For example, if I want to plot 4 plots the code would be: figure() plot(x1,y1,x2,y2,x3,y3,x4,y4) show() But the number of plots is variable and could be anywhere from 5-30. Any ideas on how I can do this? I already have the rest of my program working. The program reads all of the data from all of the files in a target directory and writes the data to X and Y lists. Thanks for any help. -- If you reply to this email, your message will be added to the discussion below: http://matplotlib.1069221.n5.nabble.com/Multiple-XY-plots-tp40451.html To start a new topic under matplotlib - users, email ml-node+s1069221n...@n5.nabble.com To unsubscribe from matplotlib, click herehttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx . NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=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/Multiple-XY-plots-tp40451p40453.html Sent from the matplotlib - users mailing list archive at Nabble.com.-- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users