You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
(9) |
2
(1) |
3
(4) |
4
(4) |
5
(9) |
6
(5) |
7
(12) |
8
(5) |
9
(27) |
10
(10) |
11
(4) |
12
|
13
(6) |
14
(12) |
15
(16) |
16
(13) |
17
(9) |
18
(1) |
19
(2) |
20
(4) |
21
(9) |
22
(5) |
23
(2) |
24
(6) |
25
|
26
(1) |
27
(9) |
28
(7) |
29
(2) |
30
(9) |
|
|
From: thecommexokid <the...@gm...> - 2011-06-05 23:01:16
|
Hi all, I am new to the forum and to all things PyGTK and matplotlib, so go easy on me, please. A colleague created a Python program that uses matplotlib and GTK. I wanted to be able run her program on my MacBook (OS X 10.6.7). I used macports to update/obtain Python 2.7, matplotlib 1.0.1, and PyGTK 2.22.0. (I also obtained ipython, if anyone cares.) After all of this, my colleague's program hits a snag when I try to run it; here is the traceback: Traceback (most recent call last): File "main.py", line 5, in from interface import Interface, Display, Controls File "/Users/thecommexokid/Documents/CurrentProjects/Honors/DoubleSlit/interface.py", line 5, in <module> from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py", line 10, in <module> from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\ File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 28, in <module> from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_gdk.py", line 29, in <module> from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array ImportError: No module named _backend_gdk I believe I may be having the same problem as the user in http://old.nabble.com/_backend_gdk-not-found-td26514059.html#a26514059 this post , but I am enough of a novice that the solution that was suggested there just sounds like gobbletygook to me. If anybody wants to elaborate on that so I can try it out, please do. Anyhow, any advice anyone has on how to overcome this problem and get her program running on my machine would be greatly appreciated. As I said, I am new to these things, and I don't really understand the interplay between Python, PyGTK, and matplotlib, so if there's crucial information I haven't provided, or if this isn't the best forum in which to be asking this question, let me know. Thanks in advance for the help. *** PS: I originally posted this question at the GTK+ Forums ( http://www.gtkforums.com/viewtopic.php?f=3&p=69969#p69969 thread ), but it seemed as though this might be the more appropriate forum. I'll be sure to keep both threads updated with any developments. -- View this message in context: http://old.nabble.com/ImportError-when-I-import-FigureCanvasGTKAgg%E2%80%94seeking-advice%21-tp31779648p31779648.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: John J. <jw...@gm...> - 2011-06-05 21:47:43
|
OK, I just found the fix within two minutes of my last email to you (after spending 6 hours on it)!! I needed to use the following variant for the macports installation (like I said, I rather new at the Mac and unix): sudo port install py26-matplotlib @1.0.1 +gtk2 for the matplotlib installation. it works now, although I still get this message: Xlib: extension "RANDR" missing on display "/tmp/launch-KDlxaE/org.x:0". thanks, john |
From: Carlos G. <car...@gm...> - 2011-06-05 21:38:45
|
Hi all, I'm developing an app for structural geology called OenStereo ( www.igc.usp.br/openstereo), using matplotlib and wxpython. So far, I'm really happy with the results, but there is still one thing annoying me: when I save the plots (using the save icon in the NavigationToolbar), the resulting figure size is determined by the size of the window. Can I set this to a fixed value (like 15cm)? this is a part of the code where I create the figure: #initialize the figure and canvas self.stereoFigure = Figure(figsize=(4,4),facecolor='white') self.stereoCanvas = FigureCanvas(self, -1, self.stereoFigure) self.toolbar = VMToolbar(self.stereoCanvas) self.stereoCanvas.mpl_connect("motion_notify_event", self.OnMove) #initialize the plot area self.plotaxes = self.stereoFigure.add_axes([0.01, 0.01, 0.6, 0.98], clip_on='True',xlim=(-1.1,1.2), ylim=(-1.15,1.15), adjustable='box',autoscale_on='False',label='stereo') self.plotaxes.set_axis_off() self.plotaxes.set_aspect(aspect='equal', adjustable=None, anchor='W') best Carlos -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano http://lattes.cnpq.br/5846052449613692 Linux User #89721 ________________ Can’t stop the signal. |
From: John J. <jw...@gm...> - 2011-06-05 21:38:41
|
I am having the old "no gdk backend" problem with GTKAgg. I am running OS X 10.6 (Snow Leopard), and, uh, I'm kind of new to Unix :). I installed the following through Macports: python26 @2.6.6_3 (active) py26-gtk @2.22.0_1 (active) py26-matplotlib @1.0.1_3+tkinter (active) py26-numpy @1.6.0_0+atlas+gcc44 (active) and the following code: > > from numpy import * > import gtk > import gobject > import matplotlib > matplotlib.use('GTKAgg') > import matplotlib.pyplot as plt > gives the following error on the pyplot import: > > pydev debugger: warning: psyco not available for speedups (the debugger will > still work correctly, but a bit slower) > > pydev debugger: starting > > Xlib: extension "RANDR" missing on display "/tmp/launch-KDlxaE/org.x:0". > > Traceback (most recent call last): > > File > "/Applications/eclipseJavaHelios/plugins/org.python.pydev.debug_2.0.0.20110404 > 03/pysrc/pydevd.py", line 1134, in <module> > > debugger.run(setup['file'], None, None) > > File > "/Applications/eclipseJavaHelios/plugins/org.python.pydev.debug_2.0.0.20110404 > 03/pysrc/pydevd.py", line 918, in run > > pydev_imports.execfile(file, globals, locals) #execute the script > > File > "/Users/jwjameson/Dropbox/mine/PyStuff/workspace/Continuous/Pothead/Animator_P > H_MPL.py", line 20, in <module> > > import matplotlib.pyplot as plt > > File > "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit > e-packages/matplotlib/pyplot.py", line 95, in <module> > > new_figure_manager, draw_if_interactive, show = pylab_setup() > > File > "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit > e-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup > > globals(),locals(),[backend_name]) > > File > "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit > e-packages/matplotlib/backends/backend_gtkagg.py", line 10, in <module> > > from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, > FigureCanvasGTK,\ > > File > "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit > e-packages/matplotlib/backends/backend_gtk.py", line 28, in <module> > > from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK > > File > "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sit > e-packages/matplotlib/backends/backend_gdk.py", line 29, in <module> > > from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array > > ImportError: No module named _backend_gdk I noticed the page: http://matplotlib.sourceforge.net/faq/installing_faq.html <http://matplotlib.sourceforge.net/faq/installing_faq.html> says nothing about Macports. I noticed the page http://old.nabble.com/_backend_gdk-not-found-td26514059.html <http://old.nabble.com/_backend_gdk-not-found-td26514059.html> where Mr. Hunter says: > matplotlib is probably not finding pygtk at build time -- you need > have pkg-config installed, and locate your pygtk-2.0.pc file and then > add that path to your PKG_CONFIG_PATH. You can check the output of > the build script at the beginning in the section > > OPTIONAL BACKEND DEPENDENCIES > libpng: 1.2.27 > Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 > wxPython: 2.8.8.0 > * WxAgg extension not required for wxPython >= 2.8 > Gtk+: gtk+: 2.14.4, glib: 2.18.2, pygtk: 2.13.0, > pygobject: 2.15.3 > Mac OS X native: no > Qt: Qt: 3.3.8, PyQt: 3.17.4 > Qt4: Qt: 4.4.3, PyQt4: 4.4.4 > Cairo: 1.4.12 > > You need to have an entry for Gtk or else the backend will not be built. > but I have no idea how to utilize this info with Macports. I was not able to locate a pygtk-2.0.pc file. If there were such a file, would Macports look at it to configure the matplotlib installation as I would like (to be able to use the GTKAgg backend)? Any suggestions are greatly appreciated! best, john |
From: Daπid <dav...@gm...> - 2011-06-05 11:16:10
|
I am using MPL 1.0.1 with Python 2.6 over Windows XP and it works. I would like to add an advice: range(n) creates a list of size n, and stores it in memory. But in your code you are only using one number at a time. Python has a better instruction: xrange. It works exactly like range, but doesn't create the list; it will return sequentially every number without the need of storing all at once. In this simple program it makes no difference, but when you go bigger, it will. David. On Sun, Jun 5, 2011 at 3:28 AM, Joe Kington <jki...@wi...> wrote: > Your code should work (and does on my system)... > What backend, version of matplotlib, OS, etc are you running? > > On Sat, Jun 4, 2011 at 4:54 PM, Armin G <ar...@gm...> wrote: >> >> Hi everyone , >> >> I know this has been posted several times now, But I could not understand >> qietly why my simple code does not work. >> here is the code: >> http://old.nabble.com/file/p31775254/LinearConvection.py >> LinearConvection.py >> >> The problem in detail: In the solver loop ( the outer loop) , The plot >> should be updated after every time step, but it stays the same. >> >> I'm a complete noob in python, so excuse my simple communicating language. >> >> thanks alot, >> Armin >> -- >> View this message in context: >> http://old.nabble.com/Plotting-in-loop-problem%2C-not-refreshing-tp31775254p31775254.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> Simplify data backup and recovery for your virtual environment with >> vRanger. >> Installation's a snap, and flexible recovery options mean your data is >> safe, >> secure and there when you need it. Discover what all the cheering's about. >> Get your free trial download today. >> http://p.sf.net/sfu/quest-dev2dev2 >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Discover what all the cheering's about. > Get your free trial download today. > http://p.sf.net/sfu/quest-dev2dev2 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Eric F. <ef...@ha...> - 2011-06-05 01:53:37
|
https://github.com/efiring/matplotlib/blob/faq_show_draw/doc/faq/usage_faq.rst Eric, Ben, See if the section "What is interactive mode" makes sense to you. I have just added it to a feature branch (which includes some other faq madifications, mainly moving the backend section from installation to usage), but have not yet generated a pull request. It doesn't go into every detail, or into the underlying machinery. It is intended to provide just enough understanding to clear up user-level confusion about interactive mode, show, and draw, and let most relatively new users get on with their work. Eric |
From: Joe K. <jki...@wi...> - 2011-06-05 01:28:14
|
Your code should work (and does on my system)... What backend, version of matplotlib, OS, etc are you running? On Sat, Jun 4, 2011 at 4:54 PM, Armin G <ar...@gm...> wrote: > > Hi everyone , > > I know this has been posted several times now, But I could not understand > qietly why my simple code does not work. > here is the code: > http://old.nabble.com/file/p31775254/LinearConvection.pyLinearConvection.py > > The problem in detail: In the solver loop ( the outer loop) , The plot > should be updated after every time step, but it stays the same. > > I'm a complete noob in python, so excuse my simple communicating language. > > thanks alot, > Armin > -- > View this message in context: > http://old.nabble.com/Plotting-in-loop-problem%2C-not-refreshing-tp31775254p31775254.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with > vRanger. > Installation's a snap, and flexible recovery options mean your data is > safe, > secure and there when you need it. Discover what all the cheering's about. > Get your free trial download today. > http://p.sf.net/sfu/quest-dev2dev2 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Armin G <ar...@gm...> - 2011-06-05 00:54:34
|
Hi everyone , I know this has been posted several times now, But I could not understand qietly why my simple code does not work. here is the code: http://old.nabble.com/file/p31775254/LinearConvection.py LinearConvection.py The problem in detail: In the solver loop ( the outer loop) , The plot should be updated after every time step, but it stays the same. I'm a complete noob in python, so excuse my simple communicating language. thanks alot, Armin -- View this message in context: http://old.nabble.com/Plotting-in-loop-problem%2C-not-refreshing-tp31775254p31775254.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Daniel M. <dan...@go...> - 2011-06-04 12:58:03
|
Hi, have you tried the examples that I have provided a couple days ago, see below? I cannot see why it should not work. These are the absolute basics that you need to understand. Btw, there is no need to use csv2rec unless you want/need column or row headers. Here's a full script that does what you want. Now, please take the time and work through the example that I have provided. In case you need further help, please don't start a new thread but reply to this one. Best regards, Daniel # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import pylab import scipy datafile1 = 'ch1_s1_lrr.csv' datafile2 = 'ch1_s1_baf.csv' ## create dummy data data = pylab.rand(10000,12) pylab.savetxt(datafile1, data, delimiter=';') pylab.savetxt(datafile2, data, delimiter=';') ## load data and transpose a1 = pylab.loadtxt(datafile1, comments='#', delimiter=';').T print 'loading', datafile1 b1 = pylab.loadtxt(datafile2, comments='#', delimiter=';').T print 'loading', datafile2 ## axis limits #v1 = [0,98760,0,1] #v2 = [0,98760,-2,2] v1 = [0,1] v2 = [-2,2] plt.close('all') plt.figure() plt.subplot(2,1,1) #plt.axis(v2) plt.ylim(v2) #plt.plot(a1, 'r.') for i in range(6): plt.plot(a1[i]) plt.subplot(2,1,2) #plt.axis(v1) plt.ylim(v1) #plt.plot(b1, 'b.') ## need masked arrays here ## http://physics.nmt.edu/~raymond/software/python_notes/paper003.html m = b1 >= 0.05 b1masked = scipy.ma.array(b1,mask=m) ## print first two cols print b1masked[0:2] for i in range(6,12): plt.plot(b1masked[i]) plt.show() 2011/6/3 Karthikraja Velmurugan <vel...@gm...>: > import matplotlib.pyplot as plt > import pylab > datafile1 = 'ch1_s1_lrr.csv' > datafile2 = 'ch1_s1_baf.csv' > > a1 = pylab.loadtxt(datafile1, comments='#', delimiter=';') > b1 = pylab.loadtxt(datafile2, comments='#', delimiter=';') > > v1 = [0,98760,0,1] > v2 = [0,98760,-2,2] > > plt.figure(1) > > plt.subplot(2,1,1) > print 'loading', datafile1 > plt.axis(v2) > plt.plot(a1, 'r.') > > plt.subplot(2,1,2) > print 'loading', datafile2 > plt.axis(v1) > plt.plot(b1, 'b.') > > plt.show() 2011/5/30 Daniel Mader <dan...@go...>: > Hi, > > the content of the CSV is stored as an array after reading. You can > simply access rows and columns like in Matlab: > > firstrow = a1[0] > firstcol = a1.T[0] > > The .T transposes the array. > > The second element of the third row would be > > elem32 = a1[2][1] > which is equivalent to > elem32 = a1[2,1] > > A range of e.g. rows 3 to 6 is > range36 = a1[2:6] > > Please have a look here for getting started with scipy/numpy: > http://pages.physics.cornell.edu/~myers/teaching/ComputationalMethods/python/arrays.html > and > http://www.scipy.org/NumPy_for_Matlab_Users > > Hope this helps, > Daniel > > 2011/5/27 Karthikraja Velmurugan <vel...@gm...>: >> Hello Daniel, >> >> The code you have given is simple and works fab. Thank you very much. But I >> wasn't able to find an example which accesses the columns of a CSV files >> when I import data through "datafile="filename.csv"" option. It will be >> great if you could help with accessing individual columns. What excatly I am >> looking for is to access individual coulmns (of the same CSV file), do >> calculations using the two coumns and plot them into seperate subplots of >> the same graph. >> I modified the script a lil bit. Please find it below: >> >> import matplotlib.pyplot as plt >> import pylab >> datafile1 = 'ch1_s1_lrr.csv' >> datafile2 = 'ch1_s1_baf.csv' >> a1 = pylab.loadtxt(datafile1, comments='#', delimiter=';') >> b1 = pylab.loadtxt(datafile2, comments='#', delimiter=';') >> v1 = [0,98760,0,1] >> v2 = [0,98760,-2,2] >> plt.figure(1) >> plt.subplot(4,1,1) >> print 'loading', datafile1 >> plt.axis(v2) >> plt.plot(a1, 'r.') >> plt.subplot(4,1,2) >> print 'loading', datafile2 >> plt.axis(v1) >> plt.plot(b1, 'b.') >> plt.show() >> >> Thank you very much in advance for your time and suggestions. >> >> Karthik |
From: Nick V. <ni...@ev...> - 2011-06-04 11:58:07
|
I have a small problem which I suspect can be solved in an easy and elegant way, and it is simply lack of sleep/stupidity preventing me from finding it. I have a number of line drawings comprised of cartesian points. I need to project them onto a sphere (they are drawings of constellations, so I need to project them onto an imaginary celestial sphere) and convert the points into sphercal co-ordinates. I *can* map the points to a sphere, that's no problem. But obviously, when I do this they become distorted. What I want to do is find out what the points should be to get an undistorted view - i.e the mapping that will produce a projection so the points match the cartesian version. Obviously, I realise this depends on the projection used etc, but basically, a small amount of distortion is fine. I am sure there must be a simple way to achieve this, but I can't seem to manage it. --- Nick Veitch |
From: Nick V. <ni...@ev...> - 2011-06-04 11:45:09
|
I have a small problem which I suspect can be solved in an easy and elegant way, and it is simply lack of sleep/stupidity preventing me from finding it. I have a number of line drawings comprised of cartesian points. I need to project them onto a sphere (they are drawings of constellations, so I need to project them onto an imaginary celestial sphere) and convert the points into sphercal co-ordinates. I *can* map the points to a sphere, that's no problem. But obviously, when I do this they become distorted. What I want to do is find out what the points should be to get an undistorted view - i.e the mapping that will produce a projection so the points match the cartesian version. Obviously, I realise this depends on the projection used etc, but basically, a small amount of distortion is fine. I am sure there must be a simple way to achieve this, but I can't seem to manage it. --- Nick Veitch |
From: Jae-Joon L. <lee...@gm...> - 2011-06-04 05:46:55
|
The first argument of the "label" command is a list of artist to be labeled. And it does not matter whether they are associated with axes or not. What you can do, therefore, is 1) draw something as you want them in the legend 2) remove them from the axes 3) make a legend from these artists. l1, = plt.plot([1,2,3]) l1.remove() plt.legend([l1], ["test"]) If you know how to create artists w/o using axes method (or. pyplot function), you may do so of course. Regards, -JJ On Thu, Jun 2, 2011 at 3:41 AM, htaunay <ht...@gm...> wrote: > > Is there anyway to set/create legends independent of what I am plotting? > Simply manually create, position and show legends, that not necessarily are > directly linked to the graph. > > To be specific, I am plotting several points, in a scatter form, > individually, and depending on the given attributes, I manually set what > colour and marker each point will present. My intention is to create legends > that specify the categories of my data, in a way that I can manually define > what colour/marker they are linked to. > > Thanks in advance for any help! > -- > View this message in context: http://old.nabble.com/Independent-Legends-tp31752112p31752112.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: jonasr <jon...@we...> - 2011-06-03 22:25:23
|
hello, im currently working on data analysis with matplotlib/numpy/scipy, my programm plots data with plot() and waits for input commands via __call__ with the x key it is possible to save data points and plot them into the figure, the r key can be used to remove points from data/figure,. the programm works quite good so far, except if i want to remove a data point, i turned of self.dataplot.set_autoscale_on(False), to avoid that there is a zoom out when i save/remove data points. the problem is that this just works if i save an new point, if i want to remove a point via "r" the figure zooms out each time altough the autoscale is on False .... here a short part of my source code: def __call__(self, event): if event.key == "x": self.x.append(event.xdata) self.y.append(event.ydata) self.N = self.N + 1 plt.axvline(event.xdata, ymin=0, ymax=600, linestyle="--") rest = event.xdata % 4.0e-7 index = int((event.xdata-rest)/4.0e-7-1) plt.plot(self.time[index],self.temp[index],'g^') self.history.append(False) if (self.N%2 == 0) and self.N <17: p1, p2 = self.x[len(self.x)-2],self.x[len(self.x)-1] if p1>p2: p1, p2 = p2, p1 self.lgdata.append(self.linreg(p1,p2,self.messdaten)) lgx=np.arange(p1-0.001,p2+0.001,0.001) ram=len(self.lgdata)-1 plt.plot(lgx,self.lgdata[ram][0]*lgx+self.lgdata[ram][1],'r-') self.history.append(True) plt.xlabel('N = '+str(self.N)) plt.draw() elif event.key == "r": if (self.remove == True) or (self.N>16): if self.history[len(self.history)-1]==True: self.lgdata.pop() del self.dataplot.lines[len(self.dataplot.lines)-1] elif self.history[len(self.history)-1]==False: self.x.pop() self.y.pop() self.N = self.N-1 plt.xlabel('N = '+str(self.N)) del self.dataplot.lines[len(self.dataplot.lines)-1] del self.dataplot.lines[len(self.dataplot.lines)-1] self.history.pop() plt.xlabel('N = '+str(self.N)) plt.draw() i hope somebody can help me -- View this message in context: http://old.nabble.com/matplot-zoomout-draw%28%29-tp31769233p31769233.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Karthikraja V. <vel...@gm...> - 2011-06-03 18:48:18
|
Hello guys, I was able to plot when I only had 1 column. But now I have a CSV file that has 10,000 rows and 12 columns. I am trying to write a code to plot all these 12 columns into 12 subplots of one graph. Below found is my code for just one column in one csv file. BTW csv2rec does not work in my version of matplotlib. import matplotlib.pyplot as plt import pylab datafile1 = 'ch1_s1_lrr.csv' datafile2 = 'ch1_s1_baf.csv' a1 = pylab.loadtxt(datafile1, comments='#', delimiter=';') b1 = pylab.loadtxt(datafile2, comments='#', delimiter=';') v1 = [0,98760,0,1] v2 = [0,98760,-2,2] plt.figure(1) plt.subplot(2,1,1) print 'loading', datafile1 plt.axis(v2) plt.plot(a1, 'r.') plt.subplot(2,1,2) print 'loading', datafile2 plt.axis(v1) plt.plot(b1, 'b.') plt.show() Now I want to be able to import 12 columns from the same file and plot all the values of the 1st six columns and only the values less then 0.05 for the next six columns. I am a beginner for python and matplotlib and I have never used arrays before so I am stuck at this point for a more than a week. Please help!!! Any help is appreciated. Thank you for your time and valuable suggestion Karthik |
From: jonasr <jon...@we...> - 2011-06-03 17:32:08
|
hello, im currently working on an interface for data analysis based on the matplotlib gui, there is basically some data which i plot with the plot() command and then i read in some datapoints with a self written routine and the mpl_connect() method. right after that the data point gets plotted into the figure and the hole figure gets redrawn with the draw() method everything works fine so far, my only problem is that when the figure gets redrawn, there is a zoom out like when pressing the 'h' button, is there a possibility to avoid this ? the problem is I have a lot of data and a lot to zoom in before selecting a data point, so that means after each data point i have again to zoom into the figure and so on... thks for your help -- View this message in context: http://old.nabble.com/matplotlib-plot%28%29-zoomout-tp31767232p31767232.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Nicolas B. <nbi...@gm...> - 2011-06-03 17:01:19
|
Hi all, I'm plotting data which extent, in x, from -1000 to 1000. But I'm only interested in the values between x = -1 and 0. I also want to plot on an x log scale. But since the x-values are negative, I cannot use xscale("log"). I can use xscale("symlog") though and this is the behaviour I want. Unfortunately, "symlog" seems to be broken. I cannot use the linthreshx argument with a value of less then 2 (the default?). But since I'm interested in x values from -1 to 0, I have to use that argument and set it to something like 1e-5 or even smaller. If I set linthreshx to something smaller then 1, the plot breaks. Here is a simple example, taken from http://stackoverflow.com/questions/3305865/what-is-the-difference-between-log-and-symlog > import numpy > from matplotlib import pyplot > > # Enable interactive mode > pyplot.ion() > > # Draw the grid lines > pyplot.grid(True) > > # Numbers from -50 to 50, with 0.1 as step > xdomain = numpy.arange(-50,50, 0.1) > > # Plots a simple linear function 'f(x) = x' > pyplot.plot(xdomain, xdomain) > # Plots 'sin(x)' > pyplot.plot(xdomain, numpy.sin(xdomain)) > > pyplot.xscale('symlog', linthreshx=0.1) > The problem seems to be that, on the x-axis, 0 is actually 10^0 = 1, not 0. Putting something smaller then 1 will make the line go back and the axis values are wrong (when hovering with the mouse and getting the x value). I might not be using the right tool though, but how to achieve what I want? I want the x axis to look like: -10^2 -10^1 -10^0 -10^-1 -10^-2 -10^-3 ... [up to my defined minimum exponent] ... 10^-3 10^-2 10^-1 10^0 10^1 10^2 Thank you Nicolas |
From: Juan L. C. <jua...@gm...> - 2011-06-02 19:35:55
|
Hi everyone, Yesterday I published a message when I still was a non-member asking about a way of get the same functionality in Matplotlib as with gnuplot epslatex terminal. After some exhaustive research, I found in the Cookbook ( http://www.scipy.org/Cookbook/Matplotlib/LaTeX_Examples#head-b255327f7b89bb0fee34c3be7d2f6966ddc72739) that I could let LaTeX render the text using the PSfrag package. However, when I tried to reproduce the example, I discovered that it didn't work: after some more research, I stumbled upon a question in this mailing list ( http://sourceforge.net/mailarchive/message.php?msg_id=27216075) where it became clear that, with some changes made to the output of PS files, PSfrag could not read the labels anymore. My questions are, assuming I am not doing anythinkg wrong (only copy&paste, I promise): Is there anyone working on this? Should I file a bug somewhere? Is there anything I can do? Thank you in advance |
From: htaunay <ht...@gm...> - 2011-06-01 18:42:02
|
Is there anyway to set/create legends independent of what I am plotting? Simply manually create, position and show legends, that not necessarily are directly linked to the graph. To be specific, I am plotting several points, in a scatter form, individually, and depending on the given attributes, I manually set what colour and marker each point will present. My intention is to create legends that specify the categories of my data, in a way that I can manually define what colour/marker they are linked to. Thanks in advance for any help! -- View this message in context: http://old.nabble.com/Independent-Legends-tp31752112p31752112.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Brannon <gi...@gm...> - 2011-06-01 16:55:24
|
Hi Jae-Joon, Thank you for your help. For the time being, I have discovered that using pdf output and converting to eps using pdf2ps and ps2eps avoids this problem. Best, Bran Jae-Joon Lee wrote: > > Just in case, I have opened a git issue on this. > > https://github.com/matplotlib/matplotlib/issues/131 > > -JJ > > > > On Wed, Jun 1, 2011 at 1:23 PM, Jae-Joon Lee <lee...@gm...> wrote: >> I'm not 100% sure on this but it seems that this is a limitation of >> "psfrag" that the ps backend relies on. The ps backend first produces >> an eps file without TeX labels, and these TeX labels are put on the >> eps file with latex+psfrag. And it seems these TeX labels are always >> above the contents of the eps file. >> >> Unfortunately, I don't think this can be easily fixed. >> Regards, >> >> -JJ >> >> >> On Wed, Jun 1, 2011 at 6:34 AM, Brannon <gi...@gm...> wrote: >>> >>> Hi, >>> >>> I am having trouble with matplotlib 1.0.1 drawing the axis tick labels >>> over >>> the legend box in the eps output when useTex is set to true. The plot >>> shown >>> after calling plt.show() looks fine, as does the output in pdf, png, svg >>> etc. Only the postscript appears to be affected. >>> >>> The following simple example produces the png and eps files given at the >>> bottom of this post: >>> >>> import matplotlib as mpl >>> import matplotlib.pyplot as plt >>> from matplotlib import rc >>> >>> rc('text', usetex=True) >>> >>> g1 = plt.plot([1,2,3,4],[500,600,700,800]) >>> g2 = plt.plot([1,2,3,4],[700,300,700,200]) >>> g3 = plt.plot([1,2,3,4],[800,600,900,800]) >>> >>> plt.figlegend([g1,g2,g3],['test1','test2','test3'],'upper left') >>> >>> plt.savefig('image.png') >>> plt.savefig('image.eps') >>> >>> plt.show() >>> >>> http://old.nabble.com/file/p31744864/image.eps image.eps >>> http://old.nabble.com/file/p31744864/image.png image.png >>> >>> I would very much appreciate some help resolving this issue. >>> >>> Thanks >>> -- >>> View this message in context: >>> http://old.nabble.com/eps-and-useTex%3A-tick-labels-drawn-over-legend-box-tp31744864p31744864.html >>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>> >>> >>> ------------------------------------------------------------------------------ >>> Simplify data backup and recovery for your virtual environment with >>> vRanger. >>> Installation's a snap, and flexible recovery options mean your data is >>> safe, >>> secure and there when you need it. Data protection magic? >>> Nope - It's vRanger. Get your free trial download today. >>> http://p.sf.net/sfu/quest-sfdev2dev >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with > vRanger. > Installation's a snap, and flexible recovery options mean your data is > safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/eps-and-useTex%3A-tick-labels-drawn-over-legend-box-tp31744864p31751252.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: madplot <wil...@gm...> - 2011-06-01 11:12:58
|
I'd really appreciate help on this, even though I'm new to matplotlib and Nabble. Consider the following lists: [1537, 1686, 1858, 2113, 2832] [1328, 2168] with max value = 2850 For a colorbar with range 0 to max value and a colour gradient of blue, green and red, I'd like to show green at y-axis values from the first list and red at y-axis values from the second list. At any other value the bar would be blue. Values from one list never occur in the other. How would I go about accomplishing this? -- View this message in context: http://old.nabble.com/Mapping-colorbar-to-data-tp31748555p31748555.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eric O L. (EOL) <Eri...@no...> - 2011-06-01 09:52:41
|
PS: One could add to the non-interactive mode part that "pyplot.draw()" has the same effect as drawing() everything (normally, this does not display anything, but is necessary so that show() displays the drawn() elements). Right? -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31748078.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eric O L. (EOL) <Eri...@no...> - 2011-06-01 09:49:21
|
Thank you for these precisions. I think I'm starting to see more clearly what the interactive/non-interactive modes do with pyplot commands (plot(), draw(), show(),…), and with draw() methods. There is only one thing that I'm not sure about: if we look at your script and leave the ion() were you left it, shouldn't an ax.draw() be called just before the ion()? (I indeed understand from your last post that one "should not rely" on "pyplot.figure()" sending a delayed draw() request to the GUI.) So, to summarize the whole discussion: * Interactive mode: - Graph elements plotted with *pyplot* commands (not Matplotlib object methods) are displayed without the need to use draw() or show(). - However, plots done through Matplotlib objects (like Axes) are normally not displayed (even though they may be, with some backends). The actual display of such plots is done through their draw() method (or possibly pyplot.draw()). This feature might be used for optimization purposes (a graph can be refreshed on screen once even though multiple updates were performed on it through Matplotlib object method calls). - show(), if used, is non-blocking. It displays everything that was drawn() (for instance figures that were created in non-interactive mode). Things that were not drawn() might be displayed by some backends, but one should not rely on this. * Non-interactive mode - No figure or graph is displayed and/or refreshed automatically. This is useful for optimization purposes, when a graph is updated many times before it reaches its final state (modification of some elements, like changing a color, etc.). - show() displays all the drawn() elements and is blocking. It is possible to switch temporarily to interactive mode in order to make it non-blocking. => Is this correct? are there other issues that could be important for students (and myself!) to grasp so that they use Matplotlib as best as possible? -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31748057.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Juan L. C. <jua...@gm...> - 2011-06-01 08:45:13
|
Hello everyone. I am used to plot data with gnuplot, so I can easily put the figures in a LaTeX document, using the epslatex terminal. For example: file = "data.dat" set terminal epslatex set output "figure1.tex" plot file http://gnuplot-tricks.blogspot.com/2009/05/gnuplot-tricks-many-say-that-it-is.html#epslatex-terminal http://www.gnuplotting.org/introduction/output-terminals/#epslatex This way, two files are generated: one .eps file, which contains the graphics, and one .tex file, which contains the text. The great advantage of this is that text is rendered by LaTeX, so the tics, labels, etc. have the same font as the rest of the document (using the appropiate packages). Now I am starting with matplotlib, which has a much nicer API, is more scriptable and, well, is Python. But, even though I can make matplotlib render the text with LaTeX, it gets embedded into the image and I cannot achieve the same advantages I had with gnuplot. Is there any way I can emulate the epslatex terminal in matplotlib? Thank you very much! |
From: Jae-Joon L. <lee...@gm...> - 2011-06-01 04:24:52
|
Just in case, I have opened a git issue on this. https://github.com/matplotlib/matplotlib/issues/131 -JJ On Wed, Jun 1, 2011 at 1:23 PM, Jae-Joon Lee <lee...@gm...> wrote: > I'm not 100% sure on this but it seems that this is a limitation of > "psfrag" that the ps backend relies on. The ps backend first produces > an eps file without TeX labels, and these TeX labels are put on the > eps file with latex+psfrag. And it seems these TeX labels are always > above the contents of the eps file. > > Unfortunately, I don't think this can be easily fixed. > Regards, > > -JJ > > > On Wed, Jun 1, 2011 at 6:34 AM, Brannon <gi...@gm...> wrote: >> >> Hi, >> >> I am having trouble with matplotlib 1.0.1 drawing the axis tick labels over >> the legend box in the eps output when useTex is set to true. The plot shown >> after calling plt.show() looks fine, as does the output in pdf, png, svg >> etc. Only the postscript appears to be affected. >> >> The following simple example produces the png and eps files given at the >> bottom of this post: >> >> import matplotlib as mpl >> import matplotlib.pyplot as plt >> from matplotlib import rc >> >> rc('text', usetex=True) >> >> g1 = plt.plot([1,2,3,4],[500,600,700,800]) >> g2 = plt.plot([1,2,3,4],[700,300,700,200]) >> g3 = plt.plot([1,2,3,4],[800,600,900,800]) >> >> plt.figlegend([g1,g2,g3],['test1','test2','test3'],'upper left') >> >> plt.savefig('image.png') >> plt.savefig('image.eps') >> >> plt.show() >> >> http://old.nabble.com/file/p31744864/image.eps image.eps >> http://old.nabble.com/file/p31744864/image.png image.png >> >> I would very much appreciate some help resolving this issue. >> >> Thanks >> -- >> View this message in context: http://old.nabble.com/eps-and-useTex%3A-tick-labels-drawn-over-legend-box-tp31744864p31744864.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Simplify data backup and recovery for your virtual environment with vRanger. >> Installation's a snap, and flexible recovery options mean your data is safe, >> secure and there when you need it. Data protection magic? >> Nope - It's vRanger. Get your free trial download today. >> http://p.sf.net/sfu/quest-sfdev2dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > |
From: Jae-Joon L. <lee...@gm...> - 2011-06-01 04:23:49
|
I'm not 100% sure on this but it seems that this is a limitation of "psfrag" that the ps backend relies on. The ps backend first produces an eps file without TeX labels, and these TeX labels are put on the eps file with latex+psfrag. And it seems these TeX labels are always above the contents of the eps file. Unfortunately, I don't think this can be easily fixed. Regards, -JJ On Wed, Jun 1, 2011 at 6:34 AM, Brannon <gi...@gm...> wrote: > > Hi, > > I am having trouble with matplotlib 1.0.1 drawing the axis tick labels over > the legend box in the eps output when useTex is set to true. The plot shown > after calling plt.show() looks fine, as does the output in pdf, png, svg > etc. Only the postscript appears to be affected. > > The following simple example produces the png and eps files given at the > bottom of this post: > > import matplotlib as mpl > import matplotlib.pyplot as plt > from matplotlib import rc > > rc('text', usetex=True) > > g1 = plt.plot([1,2,3,4],[500,600,700,800]) > g2 = plt.plot([1,2,3,4],[700,300,700,200]) > g3 = plt.plot([1,2,3,4],[800,600,900,800]) > > plt.figlegend([g1,g2,g3],['test1','test2','test3'],'upper left') > > plt.savefig('image.png') > plt.savefig('image.eps') > > plt.show() > > http://old.nabble.com/file/p31744864/image.eps image.eps > http://old.nabble.com/file/p31744864/image.png image.png > > I would very much appreciate some help resolving this issue. > > Thanks > -- > View this message in context: http://old.nabble.com/eps-and-useTex%3A-tick-labels-drawn-over-legend-box-tp31744864p31744864.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |