[Matplotlib-users] Plotting line with sharp peaks
Hi, I want to plot a line with very sharp features and many data points. If I plot the data with markers, the features can be seen perfectly. But if I choose the line style just to be '-' (which is also default), the peaks are not shown anymore. If I use something like '-o', the peaks are there, but the line does not fully join the individual markers at the peak. Is the '-' style doing some averaging before plotting or is it a rendering problem? And any suggestions how to get rid of it? Thanks a lot! Stefan -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plotting line with sharp peaks
Thank you. O.k. a little bit more: I just installed 0.99.1.1. Without path.simplify to False the problem is still there. So the "bug" might be still there. Thanks a lot again. Stefan P.S.: just in case someone wants to confirm an example: from scipy.special import sph_jn,sph_yn import numpy as np import pylab as py a_s = 2.5e-6 nsph = 1.59 mrel = 1.59 l = 30.0 m = 30.0 k=l jnx= lambda t: (sph_jn(k,t)[0][-1]) xjnx= lambda t: (t*sph_jn(k,t)[1][-1]+sph_jn(k,t)[0][-1]) hnx= lambda t: (sph_jn(k,t)[0][-1]+1j*sph_yn(k,t)[0][-1]) xhnx= lambda t: (t*sph_jn(k,t)[1][-1]+sph_jn(k,t)[0][-1]+1j*(t*sph_yn(k,t)[1] [-1]+sph_yn(k,t)[0][-1])) F= lambda rho: (((1*mrel**2*jnx(mrel*rho)*xjnx(rho)-1*jnx(rho)*xjnx(mrel*rho))/(1*mrel**2*jnx(mrel*rho)*xhnx(rho)- 1*hnx(rho)*xjnx(mrel*rho datax=[(x0)for x0 in np.arange(22,22.8,.0001)] datay=[(F(x0))for x0 in datax] py.figure() py.plot(datax,datay,'-',lw=1) py.show() On Tuesday 15 December 2009 04:43:03 pm Jouni K. Seppänen wrote: > stefan writes: > > I want to plot a line with very sharp features and many data points. > > [...] Is the '-' style doing some averaging before plotting or is it a > > rendering problem? > > What version of matplotlib do you have? There have been some path > simplification bugs fixed recently. Try setting path.simplify to False > in the matplotlibrc file. > -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Evaluation of animated oscilloscope in gtk app and weird X error
Hi folks, I just created a tiny prototype of an 'oscilloscope'. I get live data from a robot via UDP. My network class calls the update() of the oscilloscope. The oscilloscope is part of an existing GTK app which runs on an Ubuntu. I have three questions: 1) Since it's my first animation with matplotlib I'm not sure if this is really the best way to do it (probably not :)). I especially dislike the creation of np.array which could take a bit once I have a lot of data. 2) Is the integration in a GTK app like it is now ok or is there a better way? I don't want to loose the zoom and move ability of the standard plot figure though. And I need fast results so I don't want to spent to much time tweaking this. 3) I get a *weird* X error when calling the update method from the network class which probably doesn't have to do anything with matplotlib but I'm asking anyway :) robo...@robocup2-laptop:~/fumanoid/Desktop-Debug-YUV422$ ../install.py /usr/lib/pymodules/python2.6/matplotlib/backends/backend_gtk.py:621: DeprecationWarning: Use the new widget gtk.Tooltip test from 0: 254/508 The program 'install.py' received an X Window System error. This probably reflects a bug in the program. The error was 'RenderBadPicture (invalid Picture parameter)'. (Details: serial 11627 error_code 158 request_code 148 minor_code 7) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) Sometimes it crashes instantly, sometimes it works for a few calls. Calling update() from the interactive shell works fine though and displays everything. So I don't know if it's really X like the error message suggests or what. Did anybody of you experience something like this? This is the oscilloscope: import numpy as np import matplotlib #matplotlib.use('GTKAgg') # do this before importing pylab # does not really change anything import pylab import matplotlib.pyplot as plt class Oscilloscope(): def __init__(self): # var for a moving window; not implemented yet self.NO_OF_DATA_TO_PLOT = 0 plt.ion() self.fig = plt.figure() self.ax = self.fig.add_subplot(111) self.ax.grid() # list of raw data self.raw_data_x = [] self.raw_data_y = [] self.graph_lim = dict(x_min=None, x_max=None, y_min=None, y_max=None) # get line of data to be able to extend it later self.line, = self.ax.plot(np.array(self.raw_data_x), np.array(self.raw_data_y)) # open the figure window self.fig.canvas.draw() def update(self, x, y): """Draw new data consisting of x and y.""" print 'in update' self.raw_data_x.append(x) self.raw_data_y.append(y) # add new data self.line.set_xdata(np.array( self.raw_data_x)) self.line.set_ydata(np.array(self.raw_data_y)) # redraw the canvas self._limit_plot(x, y) self.fig.canvas.draw() Best, Stefan -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] cross-tabulation and plot in matplotlib
Hi, you might want to look here: http://matplotlib.sourceforge.net/tutorial.html If I understand what you mean by cross-table and graph, then you are just plotting two lines of data? That would require: pylab.plot(x, y1, 'ro', x, y2, 'bo') or something like that. Look at the tutorials. And you would need the data. A good idea is to write them in a simple ascii file. Please have a look at the following page: http://www.scipy.org/Cookbook/InputOutput This would require for example: data = numpy.loadtxt('table.dat', unpack=True) When I need to plot data from a file where the data is seperated by comma (csv file), I do something like this: import pylab data = pylab.load(filename, delimiter=',',skiprows=1) # the first row is often a table header fig = pylab.figure() ax = fig.add_subplot(111) # if you need more then one plot per figure, just change here ax.set_xlabel(cals['x units']) ax.set_ylabel('y units') ax.plot(data[::,0],data2[::,1]) # this plots col 0 against col 1, uses all the rows ax.autoscale_view() ax.grid(True) pylab.show() Cheers, Stefan 2008/10/15 He Jibo <[EMAIL PROTECTED]> > Dear All, > > I am sorry for the bother, but could you please give me some help? > I have some pilot data, which is too large to graph in excel, about 16MB. > So I hope I can do the cross-tabulation and plot in matlab. How can I draw a > cross-table and graph with matlab like the one in the attachment? > Thank you so much for your time ! Good night! > > > He Jibo > [EMAIL PROTECTED] > [EMAIL PROTECTED] > > > --- > He Jibo > Department of Psychology, > Beckman Institute for Advanced Science and Technology > University of Illinois, Urbana Champaign, > 603 East Daniel St., > Champaign, IL 61820 > Tel: 217-244-4461(office) > 217-244-6763(lab) > Email: [EMAIL PROTECTED] > Helen Hayes - "Age is not important unless you're a cheese." > > > - > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] basemap UTM conversion discrepancy
Hello, I'm starting to use the mpl_toolkits.basemap.pyproj.Proj class to do lon/lat to UTM coordinate conversion. I did some tests and noticed that there is a discrepancy between the mpl_toolkits.basemap.pyproj.Proj output and the proj commandline tool output. e.g.: I'm converting the coordinates lat=48.2; lon=16.5 to UTM coordinates UTM zone 33 with WGS84 ellipse. I'm using the following proj4 string for the conversion: +proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs The output using mpl_toolkits.basemap.pyproj.Proj is: x: 611458.865; y: 5339596.032 The proj commandline tool using the same proj4 string gives: x: 611458.69 y: 5339617.54 As you can see, the y coordinate differs significantly. Here's the code used with the basemap pyproy classes: -- from mpl_toolkits.basemap.pyproj import Proj # I got the proj string from # http://spatialreference.org/ref/epsg/32633 myProj = Proj("+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs") lat = 48.2 lon = 16.5 (x,y) = myProj(lon, lat) print "x: %.3f; y: %.3f" % (x,y) --- Can somebody explain me this behavior? Regards, Stefan. signature.asc Description: This is a digitally signed message part -- Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap UTM conversion discrepancy
Hi Jeff, I'm not an expert in coordinate transformation and the usage of proj, so I can't exactly tell you if I have all the datum files installed. If you could tell me what files could be missing I could search for them. What makes me wonder, is that you get the results that my mpl_toolkits.basemap.pyproj.Proj usage produced. When using some conversion tools on the internet like http://home.hiwaay.net/~taylorc/toolbox/geodesy/datumtrans/ or http://www.uwgb.edu/dutchs/UsefulData/ConvertUTMNoOZ.HTM I get the results that my commandline proj produces. So I think that something with my pyproj installation is not working. Regards, Stefan. Am Montag, den 19.12.2011, 15:51 -0700 schrieb Jeff Whitaker: > On 12/19/11 2:23 PM, Stefan Mertl wrote: > > Hello, > > > > I'm starting to use the mpl_toolkits.basemap.pyproj.Proj class to do > > lon/lat to UTM coordinate conversion. > > I did some tests and noticed that there is a discrepancy between the > > mpl_toolkits.basemap.pyproj.Proj output and the proj commandline tool > > output. > > > > e.g.: I'm converting the coordinates lat=48.2; lon=16.5 to UTM > > coordinates UTM zone 33 with WGS84 ellipse. > > I'm using the following proj4 string for the conversion: > > +proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs > > > > The output using mpl_toolkits.basemap.pyproj.Proj is: > > x: 611458.865; y: 5339596.032 > > > > The proj commandline tool using the same proj4 string gives: > > x: 611458.69 y: 5339617.54 > > > > As you can see, the y coordinate differs significantly. > > > > Here's the code used with the basemap pyproy classes: > > > > -- > > > > from mpl_toolkits.basemap.pyproj import Proj > > > > # I got the proj string from > > # http://spatialreference.org/ref/epsg/32633 > > myProj = Proj("+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m > > +no_defs") > > > > lat = 48.2 > > lon = 16.5 > > > > (x,y) = myProj(lon, lat) > > > > print "x: %.3f; y: %.3f" % (x,y) > > > > --- > > > > Can somebody explain me this behavior? > > > > Regards, > > Stefan. > > > Stefan: > > When I run this test, I get the same answer with both, and it is the > same as the answer basemap.pyproj gave you. I suspect you didn't > install the extra datum files with your command-line proj distribution. > > -Jeff > signature.asc Description: This is a digitally signed message part -- Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap UTM conversion discrepancy
Jeff, Here are the versions that I'm working with: basemap:1.0.2 matplotlib: 1.1.0 numpy: 1.5.1 libgeos:3.2.0 I ran the coordinate conversion on another computer with the same system configuration and there it works as it should. I have tried to clean my system and removed all the packages related to basemap (geos, proj) and only reinstalled the required libgeos packages. I deleted the basemap directory from the /usr/local/lib/python2.7/dist-packages. I deleted the _geoslib.so from /usr/local/lib/python2.7/dist-packages. After that I rebuilt and installed basemap. The problem still remains. Don't know what's going wrong. Stefan. Am Montag, den 19.12.2011, 18:33 -0700 schrieb Jeff Whitaker: > On 12/19/11 4:47 PM, Stefan Mertl wrote: > > Hi Jeff, > > > > I'm not an expert in coordinate transformation and the usage of proj, so > > I can't exactly tell you if I have all the datum files installed. If you > > could tell me what files could be missing I could search for them. > > > > What makes me wonder, is that you get the results that my > > mpl_toolkits.basemap.pyproj.Proj usage produced. When using some > > conversion tools on the internet like > > http://home.hiwaay.net/~taylorc/toolbox/geodesy/datumtrans/ or > > http://www.uwgb.edu/dutchs/UsefulData/ConvertUTMNoOZ.HTM > > I get the results that my commandline proj produces. > > So I think that something with my pyproj installation is not working. > > > > Regards, > >Stefan. > > Stefan: I mis-spoke in my earlier email - the answer I get with pyproj > is the same as you get with command line proj. What version of > basemap do you have installed? > > -Jeff > > > > Am Montag, den 19.12.2011, 15:51 -0700 schrieb Jeff Whitaker: > > > On 12/19/11 2:23 PM, Stefan Mertl wrote: > > > > Hello, > > > > > > > > I'm starting to use the mpl_toolkits.basemap.pyproj.Proj class to do > > > > lon/lat to UTM coordinate conversion. > > > > I did some tests and noticed that there is a discrepancy between the > > > > mpl_toolkits.basemap.pyproj.Proj output and the proj commandline tool > > > > output. > > > > > > > > e.g.: I'm converting the coordinates lat=48.2; lon=16.5 to UTM > > > > coordinates UTM zone 33 with WGS84 ellipse. > > > > I'm using the following proj4 string for the conversion: > > > > +proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs > > > > > > > > The output using mpl_toolkits.basemap.pyproj.Proj is: > > > > x: 611458.865; y: 5339596.032 > > > > > > > > The proj commandline tool using the same proj4 string gives: > > > > x: 611458.69 y: 5339617.54 > > > > > > > > As you can see, the y coordinate differs significantly. > > > > > > > > Here's the code used with the basemap pyproy classes: > > > > > > > > -- > > > > > > > > from mpl_toolkits.basemap.pyproj import Proj > > > > > > > > # I got the proj string from > > > > # http://spatialreference.org/ref/epsg/32633 > > > > myProj = Proj("+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m > > > > +no_defs") > > > > > > > > lat = 48.2 > > > > lon = 16.5 > > > > > > > > (x,y) = myProj(lon, lat) > > > > > > > > print "x: %.3f; y: %.3f" % (x,y) > > > > > > > > --- > > > > > > > > Can somebody explain me this behavior? > > > > > > > > Regards, > > > > Stefan. > > > > > > > Stefan: > > > > > > When I run this test, I get the same answer with both, and it is the > > > same as the answer basemap.pyproj gave you. I suspect you didn't > > > install the extra datum files with your command-line proj distribution. > > > > > > -Jeff > > > > > > > > > > > > -- > > > Write once. Port to many. > > > Get the SDK and tools to simplify cross-platform app development. Create > > > new or port existing apps to sell to consumers worldwide. Explore the > > > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > > > http://p.sf.net/sfu/intel-appdev > > > > > > > > > ___ > > > Matplotlib-users mailing list > > > Matplotlib-users@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > signature.asc Description: This is a digitally signed message part -- Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] basemap-1.0.4 UTM support
The UTM support is great. Thanks for that. Is there a possibility to display the projected coordinates without the reduction of the x/y coordinates to 0/0 in the left bottom corner? Regards, Stefan. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap-1.0.4 UTM support
What's the reason for the reduction to 0/0? I'm going to create some interactive maps. For this it would be easier to have the original projected coordinates as the coordinates of the map axes. Would it be possible to add a flag to decide if the coordinates should be reduced or not? Regards, Stefan. On Fri, 2012-07-13 at 21:26 -0600, Jeff Whitaker wrote: > On 7/13/12 8:18 AM, Stefan Mertl wrote: > > The UTM support is great. Thanks for that. > > Is there a possibility to display the projected coordinates without the > > reduction of the x/y coordinates to 0/0 in the left bottom corner? > > > > Regards > >Stefan. > > Stefan: No - that's the only coordinate system Basemap supports. > > -Jeff > > > > > > -- > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > ___ > > Matplotlib-users mailing list > > Matplotlib-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] colormap from blue to transparent to red
Hi everyone, I am having trouble with colormaps unsing pcolormesh. I would like to plot and colorise a seismic wave field above a map. Plotting works fine but I do not know how to bring transparency into colormaps. For negative values I want the coloration being blue then it should become transparent and the greatest value should be drawn red. I have tried a lot but without any success. As far as I can see, the keyarg alpha does not fit my needs at all. Do you have any suggestions for me? Regards Stefan -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] colormap from blue to transparent to red
Ben, thanks a lot! Your way does exactly what I want. Scott, I do not understand your solution, unfortunately. I have already known the example from the gallery. But up to now, I have not dealt with masked arrays. Anyway ... Thanks a lot again. Stefan -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] how to make a polar plot just of a section with grid
Hello everyone, I want to make a polar plot with grid not of the full circle but a section (e.g. r=[5:6], phi=[-20:30]). The result should look like this: http://homepages.physik.uni-muenchen.de/~Stefan.Mauerberger/example.png I have tried a lot and had also looked to the examples but my results are not satisfying. This example http://matplotlib.sourceforge.net/examples/axes_grid/demo_curvelinear_grid.html seems to be highly relevant for my needs but i do not understand it at all. I tried two different ways: Using the option polar=True works fine but I was not able to shrink the plot to the section. Otherwise transforming the data to cartesian coordinates (e.g. pcolor(r*np.sin(phi),r*np.cos(phi),data) ) the data are plotted into a box. But in this case I do not know how to draw a grid. Could anyone give me some advice how to do this? Regards Stefan -- Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] how to make a polar plot just of a section with grid
Hi Frederick, thanks for your answer. The option *faceted* I already knew but this is not exactly what I want. Perhaps it would be possible to draw the grid without labels. My goal is to draw a grid with labels above the data. Similar to the example 'demo curvelinear grid'. Regards Stefan -- Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] tick formatter - floating axis
Hello everyone, I have a question regarding the formatting of ticks in a curved coordinate system. To create my plots I am useing the mpl_toolkits.axisartist.floating_axes.GridHelperCurveLinear() function. This works quite well but I have difficulties with formatting the axis. I am working in a polar coordinate system. To format the longitudinal axis I found the function mpl_toolkits.axisartist.angle_helper.FormatterDMS() and it works good. But I want to chance the formatting of the radius too. For this I need to pass something to the kwargs tick_formatter2 of the function GridHelperCurveLinear but I do not know what. Could you give me some advice? Regards Stefan Here is the code I use: import matplotlib.pyplot as plt import mpl_toolkits.axisartist.floating_axes as floating_axes from matplotlib.projections import PolarAxes fig = plt.figure() tr = PolarAxes.PolarTransform() grid_helper = floating_axes.GridHelperCurveLinear( tr, extremes=( 1, 2, 1000, 2000 ), tick_formatter1 = None, tick_formatter2 = None ) ax1 = floating_axes.FloatingSubplot( fig, 111, grid_helper=grid_helper ) fig.add_subplot( ax1 ) ax1.grid( True ) plt.show() -- The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] tick formatter - floating axis
Hi JJ, thanks a lot for your Answer. Now I have understand how this works and created my one formatter: class MyFormatter(object): def __init__(self, fmt='$%f$'): self.fmt = fmt def __call__(self, direction, factor, values): return [self.fmt % v for v in values] Is there something like this already in Matplotlib? I looked into axisartist but can not find anything similar. Regards Stefan On Thu, 2010-11-11 at 09:38 +0900, Jae-Joon Lee wrote: > How do you want your ticklabels formatted? > > If axisartist does not provide a formatter that fits your need, you > can create a custom formatter. > Formatter for axisartist can be any callable object with following signature. > > def Formatter(direction, factor, values): > # ... > return list_of_string_that corresponds_to_values > > You may ignore direction and factor parameters for now. > For example, > > class MyFormatter(object): > def __call__(self, direction, factor, values): > _fmt = "$%.1f$" > return [_fmt % v for v in values] > > then you could do > > grid_helper = floating_axes.GridHelperCurveLinear( tr, extremes=( 1, 2, > 1000, 2000 ), tick_formatter1 = None, tick_formatter2 = MyFormatter() ) > > Regards, > > -JJ > > > On Wed, Nov 10, 2010 at 10:17 PM, Stefan Mauerberger > wrote: > > Hello everyone, > > > > I have a question regarding the formatting of ticks in a curved > > coordinate system. To create my plots I am useing the > > mpl_toolkits.axisartist.floating_axes.GridHelperCurveLinear() function. > > This works quite well but I have difficulties with formatting the axis. > > I am working in a polar coordinate system. To format the longitudinal > > axis I found the function > > mpl_toolkits.axisartist.angle_helper.FormatterDMS() and it works good. > > But I want to chance the formatting of the radius too. For this I need > > to pass something to the kwargs tick_formatter2 of the function > > GridHelperCurveLinear but I do not know what. > > > > Could you give me some advice? > > > > Regards > > > > Stefan > > > > Here is the code I use: > > > > import matplotlib.pyplot as plt > > import mpl_toolkits.axisartist.floating_axes as floating_axes > > from matplotlib.projections import PolarAxes > > > > fig = plt.figure() > > > > tr = PolarAxes.PolarTransform() > > > > grid_helper = floating_axes.GridHelperCurveLinear( tr, extremes=( 1, 2, > > 1000, 2000 ), tick_formatter1 = None, tick_formatter2 = None ) > > > > ax1 = floating_axes.FloatingSubplot( fig, 111, grid_helper=grid_helper ) > > > > fig.add_subplot( ax1 ) > > > > ax1.grid( True ) > > > > plt.show() > > > > > > -- > > The Next 800 Companies to Lead America's Growth: New Video Whitepaper > > David G. Thomson, author of the best-selling book "Blueprint to a > > Billion" shares his insights and actions to help propel your > > business during the next growth cycle. Listen Now! > > http://p.sf.net/sfu/SAP-dev2dev > > ___ > > Matplotlib-users mailing list > > Matplotlib-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > -- Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more! http://p.sf.net/sfu/dell-eql-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] colorbar: format labels with mathtext
Hi Everyone, I would like to format the labels of a colorbar with mathtext. I have tried a lot with all the cax.formatter.___ options but unfortunately I was not able to get it working. I am plotting some Data with col = ax.pcolorfast( ... ) after this I create a colorbar with cax = fig.colorbar(col) Then I would like to change the formatter and the powerlimits with cax.formatter.format = '$%1.2f$' cax.formatter.set_powerlimits( (-4,4) ) but this does not work for me. Could you pleas help me to set the powerlimits and to format the labels of a colorbar with mathtext. Regards, Stefan -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] CXX type errors help
Hi all, I am a matplotlib novice and am having problems with imported floats generated by a Perl script using the Maxmind Geo::IP library. I keep getting CXX TypeErrors which I can not seem to eliminate. Any pointers for this novice please? I write files that return longitude and latitude and then generate a plot script with the data set. Many Thanks! minimally altered example plot script___ from matplotlib.toolkits.basemap import Basemap import pylab as p # set up orthographic map projection with # perspective of satellite looking down at 50N, 100W. # use low resolution coastlines. # don' t plot features that are smaller than 1000 square km map = Basemap( projection = 'ortho', lat_0 = 50, lon_0 = -100, resolution = 'c', area_thresh = 1000. ) # draw coastlines, country boundaries, fill continents. map.drawcoastlines(linewidth=0.4) map.drawcountries(linewidth=0.2) map.fillcontinents( color = 'coral' ) # draw the edge of the map projection region (the projection limb) map.drawmapboundary() # draw lat/lon grid lines every 30 degrees. map.drawmeridians( p . arange( 0, 360, 30 ) ) map.drawparallels( p . arange( -90, 90, 30 ) ) # lat/lon coordinates of five cities. ##-changes #data [altered data set import from Maxmind Geo::IP lookups lats=[-0., 1096176317235200., 3122664919832671., 0., 0.] lons=[3.0542, 3.0423, 3.1635, 3.1523, 3.1523] cities=['Vienna US', 'Mountain View US', 'Derby GB', 'London GB', 'London GB'] ##-end chages # compute the native map projection coordinates for cities. #map floats x,y = map(lons,lats) # plot filled circles at the locations of the cities. map.plot(x,y,'bo') # plot the names of those five cities. for name,xpt,ypt in zip(cities,x,y): #p.text(xpt+5,ypt+5,name) p.text(xpt,ypt,name) p.show() __ ##error trace## Exception in Tkinter callback Traceback (most recent call last): File "c:\python25\lib\lib-tk\Tkinter.py", line 1403, in __call__ return self.func(*args) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\backends\backend_tkagg.py", line 151, in resize self.show() File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\backends\backend_tkagg.py", line 154, in draw FigureCanvasAgg.draw(self) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\backends\backend_agg.py", line 392, in draw self.figure.draw(renderer) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\figure.py", line 569, in draw for a in self.axes: a.draw(renderer) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\axes.py", line 1155, in draw a.draw(renderer) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\text.py", line 414, in draw for line, wh, x, y in info: TypeError: CXX: type error. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] TextWithDash broken
Hi, In current SVN, line 1164 of text.py (__init__ of TextWithDash) refers to "renderer" which is not defined. This breaks almost any operation. Regards Stéfan ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] TextWithDash broken
On Tue, Jun 06, 2006 at 12:32:00PM +0200, Stefan van der Walt wrote: > In current SVN, line 1164 of text.py (__init__ of TextWithDash) refers > to "renderer" which is not defined. This breaks almost any > operation. Eek! Local changes in my repository. Please disregard the previous message. *blush* Stéfan ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] showing an image on log axes?
On Tue, Jun 13, 2006 at 06:21:22AM -0500, John Hunter wrote: > setting the xscale and yscale to 'log' should work fine, as long as > you make sure the xaxis and yaxis do not contain nonpositive limits. > For an MxN image, the default limits are 0..N-1 and 0..M-1 and the 0 > will break the log transform. You can work around this by setting the > image "extent" > > from pylab import figure, show, nx > fig = figure() > ax = fig.add_subplot(111) > im = nx.mlab.rand(500,500) > ax.imshow(im, extent=(1,501,1,501)) I often want to plot matrices, with the axes labeled according to the matrix index. I.e. the top-lefthand element should be (0,0) and the bottom-righthand element (rows,columns). Setting the extent does work, i.e. ax.imshow(im,extent=(1,columns,rows,1)) If others also use this frequently, it may be useful to have a quick way of doing it (or maybe, there already is, and I've missed it). Regards Stéfan ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] showing an image on log axes?
On Thu, Jun 15, 2006 at 11:02:47AM -0600, Fernando Perez wrote: > On 6/15/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > > I often want to plot matrices, with the axes labeled according to the > > matrix index. I.e. the top-lefthand element should be (0,0) and the > > bottom-righthand element (rows,columns). Setting the extent does > > work, i.e. > > > > ax.imshow(im,extent=(1,columns,rows,1)) > > > > If others also use this frequently, it may be useful to have a quick > > way of doing it (or maybe, there already is, and I've missed it). > > See matshow(), by yours truly :) One of my few direct contributions > to mpl. There may be a better way to do what it does with today's > mpl, but it works for me (all the figures from the SANUM talk were > done with it). That's exactly what I need -- except that it forces the creation of a new figure, which doesn't play well with subplot. Specifying a figure number is, like it says in the docstring, rather unpredictable. Is there an easy way to work around that limitation? An example plot of what I would like to see is at http://mentat.za.net/results/lp.jpg Cheers Stéfan ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ANN: matplotlib-0.87.4 (bugfix release for enthon)
On Tue, Jul 11, 2006 at 10:53:59PM -0400, Charlie Moad wrote: > 2006-06-22 Added support for numerix 2-D arrays as alternatives to >a sequence of (x,y) tuples for specifying paths in >collections, quiver, contour, pcolor, transforms. >Fixed contour bug involving setting limits for >color mapping. Added numpy-style all() to numerix. - EF It would be useful to have plot accept a 2-D array as well. Would patches for this be considered, or is there some reason why this can't work? At the moment, doing P.plot(z) where z is Nx2, raises RuntimeError: xdata and ydata must be the same length So it doesn't look as though this functionality will override any current feature. Regards Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ANN: matplotlib-0.87.4 (bugfix release for enthon)
Hi Eric On Wed, Jul 12, 2006 at 05:59:16PM -1000, Eric Firing wrote: > To reply more directly to your proposal now that I have thought about it > more: although I see the logic in it, I don't see much gain from your > Nx2 idea; it not very hard to simply write P.plot(z[:,0], z[:,1]). > Furthermore, implementing your idea would not conflict with present > behavior, but it would interfere with an alternative version of fancy > argument handling that I think would be much more generally useful. Could you expand on what you mean with alternative fancy argument handling? Thanks Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ANN: matplotlib-0.87.4 (bugfix release for enthon)
On Wed, Jul 12, 2006 at 05:59:16PM -1000, Eric Firing wrote: > To reply more directly to your proposal now that I have thought about it > more: although I see the logic in it, I don't see much gain from your > Nx2 idea; it not very hard to simply write P.plot(z[:,0], z[:,1]). > Furthermore, implementing your idea would not conflict with present > behavior, but it would interfere with an alternative version of fancy > argument handling that I think would be much more generally useful. Thanks, I found the description in the other thread. Regards Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] passing 1D or 2D arrays to contour, pcolor, image, plot
On Thu, Jul 13, 2006 at 10:34:11AM +0200, Mark Bakker wrote: > To be honest, I think the native array storage order matters a lot. > When you have a large dataset, transposing the matrix is not a cheap > command. If you use numpy, transposing is cheap. You see it when you try import numpy as N z = N.random.random([1000,1000]) print "Transposing..." for x in range(1): z.transpose() in the latest SVN of numpy, they also have the convencience-shorthand of z.T (which calls z.transpose()). Regards Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot command: more flexible argument handling
On Wed, Jul 12, 2006 at 01:19:41PM -1000, Eric Firing wrote: > To summarize, the options seem to be: > > 1) Leave plot argument parsing alone. > 2) Accept an Nx2 array in place of a pair of arguments containing x and y. > > 3) Implement the Matlab model. > 4) Implement the Matlab model, but taking rows instead of columns in an > X or Y array that is 2-D. > > I am open to arguments, but my preference is the Matlab model. I don't > think that the difference in native array storage order matters much. > It is more important to have the API at the plot method and function > level match the way people think. I wasn't aware of the matlab model when I made the suggestion -- havn't used it for such a long time! Option (3) looks good for consistency: for one argument, always plot agains row index, for two arguments, plot columns of x to columns of y, using broadcasting if necessary (i.e. if either x or y is a vector). Regards Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ANN: matplotlib-0.87.4 (bugfix release for enthon)
On Thu, Jul 13, 2006 at 07:45:37AM -0500, John Hunter wrote: > > "Eric" == Eric Firing <[EMAIL PROTECTED]> writes: > Eric> To reply more directly to your proposal now that I have > Eric> thought about it more: although I see the logic in it, I > Eric> don't see much gain from your Nx2 idea; it not very hard to > Eric> simply write P.plot(z[:,0], z[:,1]). Furthermore, > > And with the new .T attribute in numpy, you can do > > from numpy import rand > X = rand(20,2) > plot(*X.T) Except that rand is no longer in the numpy namespace :) One reason why I don't like this syntax is that you can't use further arguments or keywords easily: def foo(a,b,c,keyw="asd"): print a,b,c,keyw x = ['1','2','3] foo(*x) # works fine foo(*x,"123") # breaks foo(*x,keyw="123") # breaks foo(*x,**{'keyw'="123"}) # works But I guess you can always plot first and adjust parameters later. Cheers Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Compiled against version 90709 of C-API... numpy is 90907
On Thu, Jul 13, 2006 at 08:21:14PM -0400, Darren Dale wrote: > On Thursday 13 July 2006 8:08 pm, Brian Wilfley wrote: > > I'm afraid I mixed and matched inappropriately withe the enthought 2.4 > > beta 3 and matplotlibe 0.87.4 py2.4 pairing. > > > > Any thoughts? > > > > > RuntimeError: module compiled against version 90709 of C-API but this > > version of numpy is 90907 > > I think the numpy version provided with enthought is pulled from the svn > repository. If this is true, it will make life difficult for packages like > matplotlib for windows that are compiled against the latest numpy release, in > this case 0.9.8. Somebody please correct me if I'm wrong. >From http://code.enthought.com/enthon it looks like matplotlib is distributed along with the package, so there should be no need to use a separate install of matplotlib. Regards Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plot swaps axes specified with extent
Hi all, I have a script that reads in mouse-click coordinates from an image. I noticed that, with image extents specified, the axes flip whenever I plot to them. This snippet demonstrates the behaviour I see: # -- START -- import pylab as P import numpy as N # Generate test pattern x = N.arange(100).reshape(-1,1) + N.zeros(100) def click(event): print "Mouse click at (%f,%f)" % (event.xdata,event.ydata) P.plot([event.xdata],[event.ydata],'o') P.draw() P.imshow(x,extent=(0,x.shape[1],x.shape[0],0)) P.connect('button_press_event',click) P.show() # -- END -- Is this normal? If so, how do I get around the problem? I also noticed that, even without extents, the image gets scaled after plotting. I'd appreciate any advice! Thanks for your time. Stéfan - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot swaps axes specified with extent
Hi Eric On Thu, Jul 27, 2006 at 02:57:31PM -1000, Eric Firing wrote: > That certainly looks to me like a bug, but it is not obvious to me after > a quick look where the bug is (although I suspect it is very simple), > and I can't look at it more right now. If someone else doesn't chime in > with a fix, you might want to file a bug report on sourceforge to make > sure it is not forgotten. Maybe I can take another look within the next > few days. > > What do you mean when you say "the image gets scaled after > plotting"? Thanks very much for having looked at this. My sentence above should probably have read "the limits of the x-axis change after plotting". They say two pictures are worth two-thousand words: http://mentat.za.net/refer/before_plot.png http://mentat.za.net/refer/after_plot.png Regards Stéfan - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot swaps axes specified with extent
On Thu, Jul 27, 2006 at 08:57:47PM -0400, PGM wrote: > > Is this normal? If so, how do I get around the problem? I also > > noticed that, even without extents, the image gets scaled after > > plotting. > > Try to set the "_autoscale" parameter of your current 'axes' to False. That > way, you should avoid any inopportune rescaling. For the image, try to use > aspect='auto'. > > For example, > > P.imshow(x,extent=(0,x.shape[1],x.shape[0],0)) > P.gca().set_autoscale_on(False) Thanks, P., that did the trick! It looks like the right way to fix the scaling of the axes extents, but I am still not sure whether the axis flipping behaviour I described earlier is correct. Regards Stéfan - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems upgrading to mpl 0.87.4
On Mon, Aug 14, 2006 at 11:12:29AM -0700, Christopher Barker wrote: > Another (or additional) option is for both MPL and wx to support the new > array interface protocol in numpy. There's a lot of other reasons to do > that, and, again, Robin has expressed his support for this. If we could > get MPL, wx, numpy, and PIL all passing data around with this protocol, > we'd be in great shape. Travis posted a patch to PIL for support a while > back, I don't know if it's going to get applied or not, but it's worth > looking at. Looks like it has been added already. From http://effbot.org/zone/pil-changes-116.htm - Added "fromarray" function, which takes an object implementing the NumPy array interface and creates a PIL Image from it. (from Travis Oliphant). - Added NumPy array interface support (__array_interface__) to the Image class (based on code by Travis Oliphant). This allows you to easily convert between PIL image memories and NumPy arrays: import numpy, Image i = Image.open('lena.jpg') a = numpy.asarray(i) # a is readonly i = Image.fromarray(a) Regards Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Legend outside plot
On Thu, Aug 17, 2006 at 09:48:58PM -0700, Brendan Barnwell wrote: > [I accidentally sent this message privately to the sender before. . . why > doesn't this list set the Reply-To header to the list?] I don't think mailing lists should change the reply-to: http://www.unicom.com/pw/reply-to-harmful.html Cheers Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] line styles with hollow circles?
On Thu, Sep 28, 2006 at 08:24:44PM +0200, Christian Meesters wrote: > I'd like to plot experimental data points with fitted data through it. This > time best would be to plot hollow circles for the experimental data. Pretty > much like literal 'o's (except, of course, that passing 'o' results in thick > circles). > Is this possible somehow? I'm sure someone will soon provide you with an insightful answer. In the meantime, you can fudge it by doing plot(x,y,'o',markerfacecolor='w') plot(x,y) Regards Stéfan - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to transpose a matrix
On Thu, Oct 05, 2006 at 03:50:42PM -0400, [EMAIL PROTECTED] wrote: > Is there any easy fucntion to do that? Thanks You mean like x.transpose() or x.T? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] markercolor broken
Hi all The marker behaviour changed in r2790 | nnemec | 2006-09-29 11:46:57 +0200 (Fri, 29 Sep 2006) | 1 line reworked linestyle and markercolor handling For example, try the following: N.plot(N.random.random(1000),'r.') Note that all the dots are blue! Regards Stéfan - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] subplot(1,1,[...]) and pprint_getters
Hi all First, a small bug: In [4]: s = subplot(121) In [5]: getp(s.get_frame()) --- exceptions.TypeError Traceback (most recent call last) /home/stefan/work/scipy/debug/ /home/stefan/lib/python2.4/site-packages/matplotlib/artist.py in getp(o, *args) 410 411 if len(args)==0: --> 412 print '\n'.join(insp.pprint_getters()) 413 return 414 /home/stefan/lib/python2.4/site-packages/matplotlib/artist.py in pprint_getters(self) 377 try: val = func() 378 except: continue --> 379 if hasattr(val, 'shape') and len(val)>6: 380 s = str(val[:6]) + '...' 381 else: TypeError: len() of unsized object One way to fix this would be to change line 379 in artist.py from if hasattr(val, 'shape') and len(val)>6: to if hasattr(val, 'size') and val.size > 6: Now on to my real question. Say I have a screen of 4x4 subplots, created with subplot(221). I'd like to be able to split the screen as such: __ __ | | | | | | |--| | | | | |__|__| I.e., to draw in the window on the right: subplot(2,2,[2,4]) Is there currently an easy way to do this, or would I have to combine axes manually? Any tips appreciated! Thanks Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] subplot(1,1,[...]) and pprint_getters
On Thu, Oct 12, 2006 at 07:00:05PM -0500, John Hunter wrote: > >>>>> "Stefan" == Stefan van der Walt <[EMAIL PROTECTED]> writes: > Stefan> if hasattr(val, 'size') and val.size > 6: > > This looks like a numpy vs numeric thing here so we want to make sure > the solution works across packages. This is an attempt to pretty > print an array that is long by snipping it. The problem slips in when you have a scalar, which has attribute 'shape' but no length. The above line works for Numeric, but I don't have numarray to test on. > Stefan> Now on to my real question. Say I have a screen of 4x4 > Stefan> subplots, created with subplot(221). I'd like to be able > Stefan> to split the screen as such: __ __ > Stefan> | | | > Stefan> | | | > Stefan> |--| | > Stefan> | | | > Stefan> |__|__| > > Stefan> I.e., to draw in the window on the right: > > ax1 = subplot(221) > ax2 = subplot(223) > ax3 = subplot(122) That is so simple I never even expected it to work! Thanks a lot. Cheers Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with axes size
On Sun, Oct 15, 2006 at 09:31:32PM -0200, Flavio Coelho wrote: > Hi, > > I am having a strange behavior with the size of axes in imshow. the attached > code worked fine with an older version of Pylab, but with the latest SVN, the > plots are appearing very narrow (vertically)in the middle of the window > instead > of resizing to take up the whole frame. > can anyone please illuminate me as to why this is happening? The size of the image being plotted is (72, 2048), so that behaviour sounds correct. The plot I see is shown here: http://mentat.za.net/results/morlet.png Cheers Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] windrose 0.5
On Wed, Oct 18, 2006 at 05:57:55PM +0200, Lionel Roubeyrie wrote: > Hi Derek, > happy to see you use it, here is windrose0.5 with some improvments :-) I'd like to see what the latest version does -- can you post a segment of code that demonstrates? Cheers Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] problem with ghostscript
Hi, I am trying to generate graphs using text.usetex : True ps.usedistiller : xpdf Unfortunately, when running import pylab as P P.plot([10],[10]) P.savefig('test.eps') I get an error message: File "/home/stefan//lib/python2.4/site-packages/matplotlib/backends/backend_ps.py", line 1412, in get_bbox raise RuntimeError('Ghostscript was not able to extract a bounding box.\ RuntimeError: Ghostscript was not able to extract a bounding box.Here is the Ghostscript output: ESP Ghostscript 815.02: Unrecoverable error, exit code 1 When I run with --verbose-debug-annoying I see pdftops -paper match -level2 "/tmp/098f6bcd4621d373cade4e832627b4f6.pdf" "/tmp/098f6bcd4621d373cade4e832627b4f6.ps" > "/tmp/098f6bcd4621d373cade4e832627b4f6.output" gs -dBATCH -dNOPAUSE -sDEVICE=bbox "/tmp/098f6bcd4621d373cade4e832627b4f6" ESP Ghostscript 815.02 (2006-04-19) Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. ERROR: /undefined in pdfLastFill I am running gs v8.15.2, pdftops v3.00, dvipng v1.5 and xpdf v3.01. Are these versions known to be incompatible, or is there possible a problem with the output generated by matplotlib? With ps.usedistiller : ghostscript everything runs smoothly, but the text looks pretty dismal. I would appreciate any advice on how to get this running! Thanks Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with ghostscript
On Mon, Oct 23, 2006 at 01:28:36PM -0400, Darren Dale wrote: > Hi Stefan, > > On Monday 23 October 2006 11:17, Stefan van der Walt wrote: > > I am trying to generate graphs using > > > > text.usetex : True > > ps.usedistiller : xpdf [...] > > I can't reproduce the problem here, using xpdf 3.01 (although xpdf -v returns > 3.00), pdftops 3.00, gpl ghostscript 8.54 and latex 3.141592-1.30.5-2.2 > (tetex 3.0 p1). Thanks for the feedback, Darren. I upgraded to ghostscript v8.54, after which everything works smoothly. Cheers Stéfan - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users