Re: [Matplotlib-users] "ValueError: oridinal must be >= 1" with 0.98.1 - non with 0.98.0
I used to have such errors when I was trying to display empty vectors. But since you're saying that the script work on previous version of Matplotlib... Sorry if it hasn't helped. Johan 2008/6/24 Darren Dale <[EMAIL PROTECTED]>: > On Monday 23 June 2008 23:37:09 Adam Mercer wrote: > > Hi > > > > Just upgraded to matplotlib-0.98.1, and a code that worked with 0.98.0 > > is now failing with the following error: > > Please, include a brief standalone script that demonstrates the problem > when > reporting problems. > > > Traceback (most recent call last): > > File "./plot_workout.py", line 126, in > > time_plot = time_axes.plot_date(times_dates, times, 'bo-') > > File "/opt/local/lib/python2.5/site-packages/matplotlib/axes.py", > > line 3081, in plot_date > > self.xaxis_date(tz) > > File "/opt/local/lib/python2.5/site-packages/matplotlib/axes.py", > > line 2015, in xaxis_date > > locator.refresh() > > File "/opt/local/lib/python2.5/site-packages/matplotlib/dates.py", > > line 540, in refresh > > dmin, dmax = self.viewlim_to_dt() > > File "/opt/local/lib/python2.5/site-packages/matplotlib/dates.py", > > line 436, in viewlim_to_dt > > return num2date(vmin, self.tz), num2date(vmax, self.tz) > > File "/opt/local/lib/python2.5/site-packages/matplotlib/dates.py", > > line 233, in num2date > > if not cbook.iterable(x): return _from_ordinalf(x, tz) > > File "/opt/local/lib/python2.5/site-packages/matplotlib/dates.py", > > line 156, in _from_ordinalf > > dt = datetime.datetime.fromordinal(ix) > > ValueError: ordinal must be >= 1 > > > > Any ideas? > > > > Cheers > > > > Adam > > > > - > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://sourceforge.net/services/buy/index.php > > ___ > > Matplotlib-users mailing list > > Matplotlib-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > - > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Ubuntu Hardy and matplotlib
Hi The thing is that if you installed the package matplotlib through your package manager, you are not supposed and you don't need to install it manually from the sources with the two commands I gave you. The main interest of using the source of 0.91.3 is to use a debugged version of the 0.91 release. In fact, the package 0.91.2 that you can get from your package manager still have some bugs. But maybe, you are using the 0.91.3 version since you typed "pyhton setup.py build" and "pyhton setup.py install" in the source directory (despite of the fact that you previously installed a matplotlib package). I'm not good enough in Linux to tell what is the behaviour of the system in this case. Anyway, good for you if it's actually working. :) Regards Johan 2008/6/17 Marjolaine Rouault <[EMAIL PROTECTED]>: > Dear Johan, > > I have downloaded the matplotlib 0.91.2 version (the one installed by > default by my package manager) and ran the python setup.py build as you > suggested before running the python setup.py install command. I fixed the > problem! I am so grateful for you helping me sort this out finally. I am > looking forwards to start using matplotlib. > > Cheers, marjolaine. > > >>> "Johan Mazel" <[EMAIL PROTECTED]> 06/17/08 10:15 AM >>> > Hi > I am working with matplotlib 0.91.3 on Hardy. I installed it (with "pyhton > setup.py build" and "pyhton setup.py install") from the source given on > SourceForge. And it's working perfectly. > Are you sure that you installed all the needed packages ? (Check with > "pyhton setup.py build" and see wether there is no missing packages, > especially development packages) > NB : My matplotlib work without development packages from tkinter despite > the fact that there are asked. > Regards > Johan > > 2008/6/17 Marjolaine Rouault <[EMAIL PROTECTED]>: > > > Hi, > > > > I have tried reinstalling python-matplotlib and python-matplotlib-data as > > well as reinstalling python-gtk2 and none of this proposed solutions > work. > > Still stuck unfortunately. I am thinking maybe my ubuntu is not right. > Could > > you guys let me know which repositories you use and I could try and > upgrade > > my ubuntu to one of new repositories lists? > > > > Thank > > > > > > > > -- > > This message is subject to the CSIR's copyright terms and conditions, > > e-mail legal notice, and implemented Open Document Format (ODF) standard. > > The full disclaimer details can be found at > > http://www.csir.co.za/disclaimer.html. > > > > This message has been scanned for viruses and dangerous content by > > MailScanner, > > and is believed to be clean. MailScanner thanks Transtec Computers for > > their support. > > > > > > - > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://sourceforge.net/services/buy/index.php > > ___ > > Matplotlib-users mailing list > > Matplotlib-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > -- > This message is subject to the CSIR's copyright terms and conditions, > e-mail legal notice, and implemented Open Document Format (ODF) standard. > The full disclaimer details can be found at > http://www.csir.co.za/disclaimer.html. > > This message has been scanned for viruses and dangerous content by > MailScanner, > and is believed to be clean. MailScanner thanks Transtec Computers for > their support. > > - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Ubuntu Hardy and matplotlib
Hi I am working with matplotlib 0.91.3 on Hardy. I installed it (with "pyhton setup.py build" and "pyhton setup.py install") from the source given on SourceForge. And it's working perfectly. Are you sure that you installed all the needed packages ? (Check with "pyhton setup.py build" and see wether there is no missing packages, especially development packages) NB : My matplotlib work without development packages from tkinter despite the fact that there are asked. Regards Johan 2008/6/17 Marjolaine Rouault <[EMAIL PROTECTED]>: > Hi, > > I have tried reinstalling python-matplotlib and python-matplotlib-data as > well as reinstalling python-gtk2 and none of this proposed solutions work. > Still stuck unfortunately. I am thinking maybe my ubuntu is not right. Could > you guys let me know which repositories you use and I could try and upgrade > my ubuntu to one of new repositories lists? > > Thank > > > > -- > This message is subject to the CSIR's copyright terms and conditions, > e-mail legal notice, and implemented Open Document Format (ODF) standard. > The full disclaimer details can be found at > http://www.csir.co.za/disclaimer.html. > > This message has been scanned for viruses and dangerous content by > MailScanner, > and is believed to be clean. MailScanner thanks Transtec Computers for > their support. > > > - > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Align x axises with data vectors of different size
Anyway guys, thanks a lot for the fast answer and all the good work you're doing. :) Johan 2008/6/10 Eric Firing <[EMAIL PROTECTED]>: > John Hunter wrote: > > We should consider fix the autoscaling so that tthe default view lim >> are always open intervals that contain the data. >> > > This has been on my mental list for a long time. I will look into it. > > Eric > - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Align x axises with data vectors of different size
This is exactly what I wanted. Thanks a lot. I just wanted to know wether it was possible to add a little margin for the y axes because I can't see the highest point of the curve since it's on the edge of the subplot. Anyway, thanks a lot for the good work. Johan 2008/6/10 John Hunter <[EMAIL PROTECTED]>: > On Tue, Jun 10, 2008 at 8:51 AM, Johan Mazel <[EMAIL PROTECTED]> > wrote: > > Hi > > I display two data vectors : the first is in the subplot 2,1,1 and the > > second in the subplot 2,1,2. Each of the data vectors have an x vector of > > dates to display values on x axis. > > The 2 data vectors are correlated in time and I want to show the > > correlation. > > > > But the two data vectors are not aligned as I wanted them to be since the > > data vector of subplot 2,1,2 have less element than the other one. > > > > I can't use the same x vector for both curves since it would force me to > add > > empty values in the second data vector. And I don't want to do that since > it > > would add useless points in my curve. > > > > So I need to find a way to allow me to align both data vectors on the > > different subplots without adding point to the data vector with a smaller > > number of elements. > > Does this do what you want? > > ax1 = subplot(211) > ax1.plot(x1, y1) > ax2 = subplot(212, sharex=ax1) > ax2.plot(x2, y2) > > ditto for sharey if you want to share the same y axes... > > > I > - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Align x axises with data vectors of different size
Hi I display two data vectors : the first is in the subplot 2,1,1 and the second in the subplot 2,1,2. Each of the data vectors have an x vector of dates to display values on x axis. The 2 data vectors are correlated in time and I want to show the correlation. But the two data vectors are not aligned as I wanted them to be since the data vector of subplot 2,1,2 have less element than the other one. I can't use the same x vector for both curves since it would force me to add empty values in the second data vector. And I don't want to do that since it would add useless points in my curve. So I need to find a way to allow me to align both data vectors on the different subplots without adding point to the data vector with a smaller number of elements. Thanks Johan - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] deb or rpm packages
Hi I can't find any deb package of matplotlib in the url that you gave me. The sources are there but I'm not interested in the sources since I can find them on the official website of matplotlib. Is there any problem ? Thanks for the answer by the way. Johan mazel 2008/6/3 Andrew Straw <[EMAIL PROTECTED]>: > I have .debs for Ubuntu Hardy available at http://debs.astraw.com/hardy/ > . Note that these packages don't follow all Debian/Ubuntu guidelines and > are of lower quality than the official packages, which I recommend over > these. Nevertheless, I've packaged these things up for my personal and > my laboratory's use, and anyone is welcome to use them, too. As always, > please let me know if you find any bugs. > > (The source .dsc packages are also available at the same site, and might > work with recompilation for Debian testing and possibly older Ubuntu > versions.) > > -Andrew > > Johan Mazel wrote: > > Hi > > I'd like to know when the latest packages in *.deb or *.rpm (from the > > 0.98.0 version) will be available in the repositories ? > > If you have any addresses of "custom" repositories where I could get > > this package, it would be nice too. > > > > I prefer to have a package installed than installed the software > > myself since I think it would be easier for me if I want to uninstall it. > > > > Thanks. > > Johan Mazel > > > > > > - > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ > > > > > > ___ > > Matplotlib-users mailing list > > Matplotlib-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] deb or rpm packages
Hi I'd like to know when the latest packages in *.deb or *.rpm (from the 0.98.0 version) will be available in the repositories ? If you have any addresses of "custom" repositories where I could get this package, it would be nice too. I prefer to have a package installed than installed the software myself since I think it would be easier for me if I want to uninstall it. Thanks. Johan Mazel - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Installation of 0.91.2 maintenance + Tkinter developpement packages
Atually, I just installed g++ as you were saying and now, it's working. Thanks for the help. Johan Mazel 2008/5/30 Michael Droettboom <[EMAIL PROTECTED]>: > This is in diff format, so it indicates that it is around line 960. The > part to add is this: > > if not os.path.exists(tk_inc): > tk_inc = os.path.normpath(os.path.join(tk_lib_dir, > '../../../include/tcl' + tk_ver)) > > right after this: > > if not os.path.exists(tk_inc): >tk_inc = os.path.normpath(os.path.join(tk_lib_dir, > '../../include')) > > Cheers, > Mike > > Johan Mazel wrote: > >> Hi >> Where am I supposed to copy this piece of code in setupext.py ? At the >> begining ? At the end ? >> Thanks for the answer. >> Johan Mazel >> >> >> >> 2008/5/30 Michael Droettboom <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>: >> >> >>It seems you have two unrelated errors here. >> >>The first is that Hardy changed how Tkinter is packaged so that >>matplotlib can't find it. We do not have a workaround for this on >>the 0.91.x maintenance branch. You will need to apply this patch >>to setupext.py: >> >>+@@ -960,6 +960,9 @@ def add_tk_flags(module): >>+ if not os.path.exists(tk_inc): >>+ tk_inc = os.path.normpath(os.path.join(tk_lib_dir, >>+ '../../include')) >>++if not os.path.exists(tk_inc): >>++tk_inc = os.path.normpath(os.path.join(tk_lib_dir, >>++ '../../../include/tcl' >>+ tk_ver)) >>++ if ((not >>os.path.exists(os.path.join(tk_inc,'tk.h'))) and >> + os.path.exists(os.path.join(tcl_inc,'tk.h'))): >>+ >> >>We have a better fix on the trunk, but it requires more testing. >> >>The second error typically occurs when g++ is not installed. Try >>"sudo apt-get install g++". >> >>Cheers, >>Mike >> >>Johan Mazel wrote: >> >>Hi >>I'm trying to install the 0.91.2 maintenance from the SVN on a >>Ubuntu 8.04 system. >>But I have an error about Tkinter during the checkin of >>dependancies : >> >>OPTIONAL BACKEND DEPENDENCIES >> libpng: 1.2.15beta5 >> Tkinter: no >> * Tkinter present, but header files are >>not found. >> * You may need to install development >>packages. >> >>For all the other dependancies, there is no problem at all. >> >>When I type python setup.py build, I got this error at the end : >> >>gcc: error trying to exec 'cc1plus': execvp: Aucun fichier ou >>dossier de ce type >>gcc: error trying to exec 'cc1plus': execvp: Aucun fichier ou >>dossier de ce type >>error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g >>-fwrapv -O2 -Wall -Wstrict-prototypes -fPIC >>-I/usr/include/freetype2 -I/usr/local/include -I/usr/include >>-I. -I/usr/include/python2.5 -c CXX/cxx_extensions.cxx -o >>build/temp.linux-i686-2.5/CXX/cxx_extensions.o" failed with >>exit status 1 >> >>I'm guessing that the building error is directly related to >>the fact that I don't have the developpement package for tkinter. >>The main problem is that I can't find this package through >>Synaptic my package manager. >>If you have any idea of where this problem comes from, please, >>I'm listening. >> >>Thanks for the help. >>Johan Mazel >> >> >> >> >> - >>This SF.net email is sponsored by: Microsoft >>Defy all challenges. Microsoft(R) Visual Studio 2008. >>http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ >> >> >> >>___ >>
Re: [Matplotlib-users] Installation of 0.91.2 maintenance + Tkinter developpement packages
Hi Where am I supposed to copy this piece of code in setupext.py ? At the begining ? At the end ? Thanks for the answer. Johan Mazel 2008/5/30 Michael Droettboom <[EMAIL PROTECTED]>: > It seems you have two unrelated errors here. > > The first is that Hardy changed how Tkinter is packaged so that matplotlib > can't find it. We do not have a workaround for this on the 0.91.x > maintenance branch. You will need to apply this patch to setupext.py: > > +@@ -960,6 +960,9 @@ def add_tk_flags(module): > + if not os.path.exists(tk_inc): > + tk_inc = os.path.normpath(os.path.join(tk_lib_dir, > + '../../include')) > ++if not os.path.exists(tk_inc): > ++tk_inc = os.path.normpath(os.path.join(tk_lib_dir, > ++ '../../../include/tcl' + > tk_ver)) > ++ if ((not > os.path.exists(os.path.join(tk_inc,'tk.h'))) and > + os.path.exists(os.path.join(tcl_inc,'tk.h'))): > + > > We have a better fix on the trunk, but it requires more testing. > > The second error typically occurs when g++ is not installed. Try "sudo > apt-get install g++". > > Cheers, > Mike > > Johan Mazel wrote: > >> Hi >> I'm trying to install the 0.91.2 maintenance from the SVN on a Ubuntu 8.04 >> system. >> But I have an error about Tkinter during the checkin of dependancies : >> >> OPTIONAL BACKEND DEPENDENCIES >>libpng: 1.2.15beta5 >> Tkinter: no >>* Tkinter present, but header files are not found. >>* You may need to install development packages. >> >> For all the other dependancies, there is no problem at all. >> >> When I type python setup.py build, I got this error at the end : >> >> gcc: error trying to exec 'cc1plus': execvp: Aucun fichier ou dossier de >> ce type >> gcc: error trying to exec 'cc1plus': execvp: Aucun fichier ou dossier de >> ce type >> error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 >> -Wall -Wstrict-prototypes -fPIC -I/usr/include/freetype2 >> -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c >> CXX/cxx_extensions.cxx -o build/temp.linux-i686-2.5/CXX/cxx_extensions.o" >> failed with exit status 1 >> >> I'm guessing that the building error is directly related to the fact that >> I don't have the developpement package for tkinter. >> The main problem is that I can't find this package through Synaptic my >> package manager. >> If you have any idea of where this problem comes from, please, I'm >> listening. >> >> Thanks for the help. >> Johan Mazel >> >> >> - >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ >> >> >> ___ >> Matplotlib-users mailing list >> Matplotlib-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Installation of 0.91.2 maintenance + Tkinter developpement packages
Hi I'm trying to install the 0.91.2 maintenance from the SVN on a Ubuntu 8.04 system. But I have an error about Tkinter during the checkin of dependancies : OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.15beta5 Tkinter: no * Tkinter present, but header files are not found. * You may need to install development packages. For all the other dependancies, there is no problem at all. When I type python setup.py build, I got this error at the end : gcc: error trying to exec 'cc1plus': execvp: Aucun fichier ou dossier de ce type gcc: error trying to exec 'cc1plus': execvp: Aucun fichier ou dossier de ce type error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c CXX/cxx_extensions.cxx -o build/temp.linux-i686-2.5/CXX/cxx_extensions.o" failed with exit status 1 I'm guessing that the building error is directly related to the fact that I don't have the developpement package for tkinter. The main problem is that I can't find this package through Synaptic my package manager. If you have any idea of where this problem comes from, please, I'm listening. Thanks for the help. Johan Mazel - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Change position of graphs when using subplot
Hi I'm displaying 4 graphs in one figure. But the 4 graphs are really to much near each other and the center of the figure. Is there anyway to change this, and move them nearer to the edges of the figure ? Thanks Johan Mazel - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Remove xlabel
Hi I'm plotting data associated with dates. I have two problems. The first one is that the xlabel "date" is displayed despite that haven't set Matplotlib to do so. My code is the following one : fig = plt.figure(1) title_to_display=str("Entropy, Kullback-LeiblerL, symmetric KL and resistor KL from %s to %s"%(IP_list_RTT[i][0].split("_")[1],IP_list_RTT[i][0].split("_")[2])) ax_1 = fig.add_subplot(2,2,1) ax_1.plot(dates_RTT,data_RTT,'r-') ax_2 = twinx() ax_2.plot(dates_distances,entropy_list) ax_2.plot(dates_distances,kullback_leibler_list) ax_2.plot(dates_distances,symmetric_kullback_leibler_list) ax_2.plot(dates_distances,resistor_average_kullback_leibler_list) ax_2.yaxis.tick_right() title(title_to_display,fontsize=size_font_title) ax_1.grid(True) ax_1.xaxis.set_major_formatter(formatter_1) ax_2.xaxis.set_major_formatter(formatter_2) labels_x1 = ax_1.get_xticklabels() labels_x2 = ax_2.get_xticklabels() setp(labels_x1, rotation=rotation_x_label, fontsize=size_font_x_label) setp(labels_x2, rotation=rotation_x_label, fontsize=size_font_x_label) All the variables relatives to the display (rotation_x_label,size_font_x_label,size_font_title) are defined before. If I add xlabel("tutut"), I just get "tutut" print over the two previous "date" (one for ax_1 and one for ax_2). It also looks like there is two x tick labels formatted displayed. I tried to define two formatters with one empty and one "normal" and assign them to the two different axes that I'm using with something like this : formatter_1 = DateFormatter('') formatter_2 = DateFormatter('%H-%M-%S') and then : ax_1.xaxis.set_major_formatter(formatter_1) ax_2.xaxis.set_major_formatter(formatter_2) But it doesn't work. If the empty formatter is the first one, it looks that both x tick labels are displayed at the same time (just as before). And if the empty formatter is the second, none of the x tick labels are displayed. Thanks in advance for the help. Regards. Johan Mazel - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plot data with specified time (hour, minute, second)
Hello I think that my problem is linked to the data struture that I'm using for the dates since my error message is : "ValueError: setting an array element with a sequence." I use list data structure, the one that you can declare through : datetime_list = []. And maybe I souldn't use this type of data structure and another one. Regards Johan Mazel * *2008/4/29 Johan Mazel <[EMAIL PROTECTED]>: > Ok. > I tried to do the job through the old way and it's working. > But I have the latest version (0.91.2). Is it possible that my version > wasn't successfully installed and that an older one is doing the job ? > Anyway, thanks a lot for the (fast) help. > Johan > > 2008/4/29 John Hunter <[EMAIL PROTECTED]>: > > > On Tue, Apr 29, 2008 at 12:10 PM, Johan Mazel <[EMAIL PROTECTED]> > > wrote: > > > When you wrote "import matplotlib.ticker", you meant "from > > matplotlib.dates > > > import ticker" ? > > > > No sorry, I meant "import matplotlib.ticker as ticker" > > > > > I think I have a bug or something because I get an error like > > "ValueError: > > > setting an array element with a sequence." with a lot of debug stuff > > from > > > python and MatPlotLib > > > The line concerned is the one where I do > > plot(datetime_list,data_list). > > > It's very strange because just before I use "my_datetime.strftime("%d > > %H %M > > > %S")" with my_datetime as an element of my list and it works > > perfectly. > > > > > > Possibly your matplotlib version is a bit old. With the latest > > release (0.91.2) you can pass sequences of native datetimes in. For > > older versions, you had to convert your dates to numbers first: > > > > import matplotlib.dates as mpldates > > > > d = mpldates.date2num(datetime_list) > > ax.plot_date(d, ydata) > > > > JDH > > > > - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plot data with specified time (hour, minute, second)
Ok. I tried to do the job through the old way and it's working. But I have the latest version (0.91.2). Is it possible that my version wasn't successfully installed and that an older one is doing the job ? Anyway, thanks a lot for the (fast) help. Johan 2008/4/29 John Hunter <[EMAIL PROTECTED]>: > On Tue, Apr 29, 2008 at 12:10 PM, Johan Mazel <[EMAIL PROTECTED]> > wrote: > > When you wrote "import matplotlib.ticker", you meant "from > matplotlib.dates > > import ticker" ? > > No sorry, I meant "import matplotlib.ticker as ticker" > > > I think I have a bug or something because I get an error like > "ValueError: > > setting an array element with a sequence." with a lot of debug stuff > from > > python and MatPlotLib > > The line concerned is the one where I do plot(datetime_list,data_list). > > It's very strange because just before I use "my_datetime.strftime("%d %H > %M > > %S")" with my_datetime as an element of my list and it works perfectly. > > > Possibly your matplotlib version is a bit old. With the latest > release (0.91.2) you can pass sequences of native datetimes in. For > older versions, you had to convert your dates to numbers first: > > import matplotlib.dates as mpldates > > d = mpldates.date2num(datetime_list) > ax.plot_date(d, ydata) > > JDH > - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Fwd: Plot data with specified time (hour, minute, second)
-- Forwarded message -- From: Johan Mazel <[EMAIL PROTECTED]> Date: 2008/4/29 Subject: Re: [Matplotlib-users] Plot data with specified time (hour, minute, second) To: John Hunter <[EMAIL PROTECTED]> When you wrote "import matplotlib.ticker", you meant "from matplotlib.dates import ticker" ? I think I have a bug or something because I get an error like "ValueError: setting an array element with a sequence." with a lot of debug stuff from python and MatPlotLib The line concerned is the one where I do plot(datetime_list,data_list). It's very strange because just before I use "my_datetime.strftime("%d %H %M %S")" with my_datetime as an element of my list and it works perfectly. Anyway, thanks a lot for the help. Johan Mazel 2008/4/29 John Hunter <[EMAIL PROTECTED]>: > On Tue, Apr 29, 2008 at 11:38 AM, Johan Mazel <[EMAIL PROTECTED]> > wrote: > > Ok. > > I manage to get either time or date but not both inside the same object > . > > And I don't know how to use plot with two object (one for the time and > the > > other for the date). > > you can get the date and time into a datetime object as follows: > > import datetime > dt = datetime.datetime(2008,4,22,3,45,21) > print dt.strftime('%Y-%m-%d %H:%M:%S') > - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plot data with specified time (hour, minute, second)
Ok. I manage to get either time or date but not both inside the same object . And I don't know how to use plot with two object (one for the time and the other for the date). Thanks for the answer. Johan Mazel 2008/4/29 John Hunter <[EMAIL PROTECTED]>: > On Tue, Apr 29, 2008 at 8:12 AM, Johan Mazel <[EMAIL PROTECTED]> > wrote: > > > I also would like to know wether I can use the same type of > functionnality > > as in Gnuplot where you can specify the format of data in input and the > data > > displayed of the x axis. I just guess that the use of the date object > > replace any kind of setup in data input but anyway... > > If you are passing in datetime objects for plotting on the x-axis, you > can format the tick labels any way you want: > > import matplotlib.ticker > > formatter = ticker.DateFormatter('%Y-%m-%d %H:%M:%S') > ax.xaxis.set_major_formatter(formatter) > > See the date_demo*.py examples at http://matplotlib.sf.net/examples > - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Plot data with specified time (hour, minute, second)
Hello I'd like to know wether Matplotlib can display data with an x axis based on day, hour, minute and seconds. I found some example and tutorial that shows that this can be done for year, month and day but not for hour, minute, seconds. It looks like matplotlib use the python type date and generate a list of date within a range (at least in the tutorials). I'd like to do the same thing but with customized date and time for each of my points. So my questions would be : can the plot function display some values with a certain time (and if possible date) for each one of the values ? Or, can the plot function use a time object as parameter for x axis ? I also would like to know wether I can use the same type of functionnality as in Gnuplot where you can specify the format of data in input and the data displayed of the x axis. I just guess that the use of the date object replace any kind of setup in data input but anyway... Thanks Regards Johan Mazel - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users