[Matplotlib-users] make plot() cycle through line style instead of colour
Dear list, if I do a plot([1,2],[1,2]) plot([1,2],[1,3]) plot([1,2],[1,4]) I will get three lines. All have linestyle='-', the colour is changed automatically: blue, green, red, ... Can I change this behaviour to: All have the colour black, and the linestyle is changed /automatically/ '-', '--', '-.', ...? Thanks in advance, Sebastian. signature.asc Description: OpenPGP digital signature -- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ellipk
hey pau! On 10/09/2010 08:04 AM, Pau wrote: ... ImportError: No module named scipy.special ... do you have scipy installed? i.e. does import scipy work? if so, what is scipy.__version__ ? here, it's 0.7.0... if scipy is not installed, i think you need to install it in order to access ellipk. good luck :) sebastian. signature.asc Description: OpenPGP digital signature -- 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] ellipk
hey pau, ellipk is in scipy.special: #!/usr/bin/env python from pylab import * from scipy.special import ellipk e=1. a_mpc = 4.0 p = a_mpc * (1 - e**2.) Phase = 4.*sqrt(p/(p -6. - 2.*e)) * ellipk(-4.*e/(p - 6. -2.*e)) greetings, sebastian. signature.asc Description: OpenPGP digital signature -- 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] How do you use ticklabel_format?
Joseph Smidt wrote: Hello, I'm trying to make a simple plot that doesn't use scientific notation for the x axis ... Is there way to use this ScalarFormatter some how? ... does this help? from pylab import * a = arange(1600) plot(a,a) xscale('log') from matplotlib.ticker import ScalarFormatter ax = gca().xaxis ax.set_major_formatter(ScalarFormatter()) best, sebastian. signature.asc Description: OpenPGP digital signature -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem using TeX
Florian Lindner wrote: Hello, I try to use LaTeX in my plot flor...@horus:~ cat .matplotlib/matplotlibrc text.usetex: true My plotting code looks like: Ma = arange(1.0, 5.0, 0.01) Ts = [T(i) for i in Ma] # BTW: Is there a way to spare this line? not sure what T is. you could try T(Ma); you can do that of course also directly in the plot command plot(Ma, Ts, label=r'/frac{T2}{T1}') should be backslash and math mode: plot(Ma, Ts, label=r'$\frac{T2}{T1}$') legend() show() and that's all, no plot window appears, the script is finished. you did not show() ! best, sebastian. signature.asc Description: OpenPGP digital signature -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] vector EPS
Matthew Czesarski matthew.czesar...@gmail.com wrote: ... it seems that MPL rasterizes everything in the production of its EPS output. Is there any way to get around this ... hi matt, i think i know maybe what you mean: if i save a matplotlib figure as eps and then use pstoedit for further processing with xfig, the ticklabels are somehow not correctly recognized as text. as far as i understand, this is an issue with the mathtext capabilities. you can see what i do as workaround in http://www.thamnos.de/repos/sebtools/sebtools.main/sebtools.py (class 'Fig', style 'f') unfortunately, i do not recall all details any more. if i was to look into that again, i would start playing with the text.usetex parameter. i would expect this to be enough to render linear axes correctly (although not as nicely). if you have logarithmic axes, it gets more complicated as something like 10^5 IS a mathtext. i've therefore made a class MyLogFormatterMathtext which outputs the labels very ugly but as normal text. i hope that something along these lines can help you, i was using pstoedit a lot to see whether the text is recognized as text or not. good luck, sebastian. This message was sent using IMP, the Internet Messaging Program. pgpJ75SNkmLnj.pgp Description: Digitale PGP-Unterschrift -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] modifying colorbar ticklabels
Mario Mech wrote: ... #-- import numpy as np from matplotlib import pyplot,mpl x = np.arange(10) y = np.arange(25) z = np.floor(10*np.random.random((25,10))) pyplot.contourf(x,y,z) cb = pyplot.colorbar() for j in cb.ax.get_yticklabels(): print(j) # results in: Text(0,0,'') ... I think you have to pyplot.show() or pyplot.savefig(deleteme.ps) in order to have the ticklabels populated. best, sebastian. signature.asc Description: OpenPGP digital signature -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] range for log scale
Janwillem van Dijk wrote: Is it possible to have in Matplotlib.pyplot a log (base 10) scale that does go from xmin to xmax where xmin and xmax are not powers of 10 ... yes. best regards, sebastian. signature.asc Description: OpenPGP digital signature -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] grid on log-plots
jihi wrote: ... can anybody tell me how to get gridlines in a logarithmic plot? ... from matplotlib.pyplot import * plot([1,10,100],[1,10,100]) grid() yscale('log') xscale('log') works here. best, sebastian. signature.asc Description: OpenPGP digital signature -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] how to generate one plot per key press?
Dr. Phillip M. Feldman wrote: Having to hit Enter is not a major problem, but I'm still not getting anything displayed. i guess that might be because the show command before the loop blocks the program. you can omit the line with show or start ipython with ipython -pylab both versions work here. good luck, sebastian. signature.asc Description: OpenPGP digital signature -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] EPS with TeX
Darren Dale wrote: On Wed, Aug 12, 2009 at 7:13 AM, D2Hitmanj.m.gir...@warwick.ac.uk wrote: Is it a problem that it is using pdftex instead of pslatex? Yes. i don't think so. the example from matplotlib.pyplot import * text(0.5, 0.5, r'a \\ b') savefig('test.eps') runs without error here -- and latex is calling pdftex: $ latex -v pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6) kpathsea version 3.5.6 Copyright 2007 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). Kpathsea is copyright 2007 Karl Berry and Olaf Weber. There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX using libpoppler copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX using libpoppler source. Primary author of pdfTeX using libpoppler: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). Kpathsea written by Karl Berry, Olaf Weber, and others. Compiled with libpng 1.2.27; using libpng 1.2.27 Compiled with zlib 1.2.3.3; using zlib 1.2.3.3 Compiled with libpoppler version 0.10.5 could the OP perhaps post some more information? sebastian. signature.asc Description: OpenPGP digital signature -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] EPS with TeX
Darren Dale wrote: the example from matplotlib.pyplot import * text(0.5, 0.5, r'a \\ b') savefig('test.eps') runs without error here -- and latex is calling pdftex: ... cup of coffee. ... the example was not fair though as it wasn't using latex... this one is now: from matplotlib import rcParams params = {'backend': 'ps', 'text.usetex': True, 'ps.usedistiller': 'xpdf', } rcParams.update(params) from matplotlib.pyplot import * text(0.5, 0.5, r'a \newline{} b') savefig('test.eps') it does not crash (the version with '\\' does) but does not produce a line break, either... best, sebastian. signature.asc Description: OpenPGP digital signature -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] EPS with TeX
finally... Sebastian Busch wrote: ... it does not crash (the version with '\\' does) but does not produce a line break, either... text(0.5, 0.5, 'a \n b') works. signature.asc Description: OpenPGP digital signature -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] histograms : xmax
hey there! Pau wrote: ... 0.00e+00 1.00e-04 81039 1.00e-04 2.00e-04 4472 2.00e-04 3.00e-04 2033 ... The bins are given by the two first number columns. For instance, the first bin is from 0.00e+00 to 1.00e-04 and has the number of data 81039 hey pau! i do not understand hist well myself, but i think it might be doing something different from what you want. i think that if you run hist on e.g. the numbers 100, 11, 10, 9, 0, 0, 0, 0, 0 and make 10 bins, it will give you x y 0 5 10 3 20 0 30 0 40 0 50 0 60 0 70 0 80 0 90 0 100 1 if you histogram the data on the y-axis, there is no reason why this should be still connected to the x-axis. you have already a histogramm -- if you want to rebin, i guess you should use histogram on the x-axis and weight with the y-data. H = load ( './histo3.dat') h = H[:, 2] # the third column n, bins, patches = hist(h, 997, normed=0, log=0, facecolor='lightblue', alpha=0.75) 0 - 9 -- on x axis Notice in the data file that x does not get further than 9.96e-02 So the maximum should be 0.0996 and I am getting 9 if you pass only the third column to hist, it is a bit unfair to expect it to know the other two ;) good luck, sebastian. signature.asc Description: OpenPGP digital signature -- Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] histograms ...
Pau wrote: ... MODE: 0.00e+00 - 1.00e-04 (2226):** 1: 1.00e-04 - 2.00e-04 ( 482):* 2: 2.00e-04 - 3.00e-04 ( 273): 3: 3.00e-04 - 4.00e-04 ( 173): 4: 4.00e-04 - 5.00e-04 ( 125):** 5: 5.00e-04 - 6.00e-04 ( 99):* 6: 6.00e-04 - 7.00e-04 ( 68):*** ... I am supposed to show this plot tomorrow and I cannot figure out how to plot this with matplotlib ... hey! i'm not sure but maybe you are looking for something like this (will crash on the text lines in the file -- you may want to add a try:... except: pass around the split thing. from scipy import * from matplotlib.pyplot import * from string import split f = open(histo.dat) data = f.readlines() f.close() x, y, dy = [], [], [] for i, line in enumerate(data): x.append(i) y.append(int(line.split('(')[1].split(')')[0])) dy.append(sqrt(y[-1])) bar(x, y, yerr=dy, align='center') show() good luck, sebastian. signature.asc Description: OpenPGP digital signature -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] histograms ...
Pau wrote: ... 2009/7/5 Gökhan SEVER gokhanse...@gmail.com: On Sun, Jul 5, 2009 at 3:41 PM, Pau vim.u...@googlemail.com wrote: ... Traceback (most recent call last): File ./prova.py, line 14, in module y.append(int(line.split('(')[1].split(')')[0])) IndexError: list index out of range 2009/7/5 Sebastian Busch webmas...@thamnos.de: Pau wrote: (2226):** 1: 1.00e-04 - 2.00e-04 ( 482):* hey there, what the line should do is to get the number out of the lengthy text. it should take what is behind a ( and before a ). my guess is that in some line of your textfile, there is no bracket. give this a try: from scipy import * from matplotlib.pyplot import * from string import split f = open(histo.dat) data = f.readlines() f.close() x, y, dy = [], [], [] for i, line in enumerate(data): try: x.append(i) y.append(int(line.split('(')[1].split(')')[0])) dy.append(sqrt(y[-1])) except: pass bar(x, y, yerr=dy, align='center') show() which will skip any error. but check if your data made it into y or were skipped as well! ;) best, sebastian. signature.asc Description: OpenPGP digital signature -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] histograms ...
Pau wrote: ... MODE: 0.00e+00 - 1.00e-04 (2226):** 1: 1.00e-04 - 2.00e-04 ( 482):* 2: 2.00e-04 - 3.00e-04 ( 273): 3: 3.00e-04 - 4.00e-04 ( 173): 4: 4.00e-04 - 5.00e-04 ( 125):** 5: 5.00e-04 - 6.00e-04 ( 99):* 6: 6.00e-04 - 7.00e-04 ( 68):*** ... i think it was the last (empty) line which was messing up things. the following works (at least here.) from scipy import * from matplotlib.pyplot import * from string import split f = open(histo2.dat) data = f.readlines() f.close() x, y, dy = [], [], [] for i, line in enumerate(data): try: y.append(int(line.split('(')[1].split(')')[0])) x.append(i) dy.append(sqrt(y[-1])) except: pass bar(x, y, yerr=dy, align='center') show() main difference is swapping of x and y append(..): if something goes wrong width y, it won't do x and therefore both will have the same length in the end (i think it was complaining about the two not having the same length). as a side note: you might want to use yscale('log') and / or xscale('log') as your data drop pretty fast. good luck good night, sebastian. signature.asc Description: OpenPGP digital signature -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] xlabels / ylabels as (non-math) text for pstoedit
Hey everyone, this is more a how-to / feature request than a question... Normally, my workflow for embedding images in LaTeX is as follows: 1) produce ps-file 2) use pstoedit (xfig) to separate text/math (LaTeX-typesettable) from the image 3) save as pdf_t and pdf, respectively 4) \input this in the LaTeX document -- pdflatex will then set the text at every compilation. This has the advantage that I can change fonts etc without having to redo all the figures. I was trying to do so with matplotlib 0.98.3 and pstoedit 3.45 on a 64bit Ubuntu 8.10. I followed the instructions in the matplotlib cookbook but kept experiencing problems when calling pstoedit [1], the xlabels and ylabels were somehow converted to Courier but not put in the text part, . would become : and so on. Solution brought this thread http://www.nabble.com/Switching-between-different-font-settings-ts21279388.html which suggested using OldScalarFormatter (thanks at this point also from my side, Jouni) -- which works, see attached example. So much for the how-to-part -- obviously, my suggestion is now to not force users to have math-labels. I have to admit that I am not aware of the drawbacks of OldScalarFormatter, but alone the name makes me think that it might be not the best solution... Thanks and best regards, Sebastian. P.S.: why actually does ax.yaxis.get_ticklabels()[1].get_text() return an empty string when called before savefig? P.P.S.: I expect to be offline several days, so please excuse me if I won't be answering timely. [1] pstoedit: version 3.45 / DLL interface 108 (build Jun 17 2008 - release build - g++ 4.3.1) : Copyright (C) 1993 - 2007 Wolfgang Glunz Warning: Level 2 version of image and imagemask not supported for this backend (due to lack of support for bitmaps on intermediate files) Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font MCSZLR+CMMI12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font MCSZLR+CMMI12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font MCSZLR+CMMI12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font MCSZLR+CMMI12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. Warning, unsupported font MCSZLR+CMMI12, using Courier instead. Warning, unsupported font YBFHZA+CMR12, using Courier instead. from matplotlib import rcParams params = {'backend': 'ps', 'ps.usedistiller': 'xpdf', 'text.usetex': True, } rcParams.update(params) from matplotlib.ticker import OldScalarFormatter import pylab from pylab import arange,pi,sin,cos,sqrt # Generate data x = pylab.arange(-2*pi,2*pi,0.01) y1 = sin(x) y2 = cos(x) # Plot data pylab.figure(1) pylab.clf() pylab.axes([0.125,0.2,0.95-0.125,0.95-0.2]) pylab.plot(x,y1,'g:',label='1sin(x)') pylab.plot(x,y2,'-b',label='cos(x)') pylab.xlabel('x (radians)') pylab.ylabel('y') pylab.legend() ax = pylab.gca() ax.xaxis.set_major_formatter(OldScalarFormatter()) ax.yaxis.set_major_formatter(OldScalarFormatter()) pylab.savefig('tex_demo.ps') signature.asc Description: OpenPGP digital signature -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlibrc customizing
Ulrich vor dem Esche wrote: ... #xtick.labelsize : 14 (from '12') #xtick.direction : out (from 'in') nothing changes ... I must have missed something very basic.. I guess that would be the # which declares everything behind as a comment. Does it work when you remove the #? Best, Sebastian. signature.asc Description: OpenPGP digital signature -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Beginning Python Visualization??
Esmail wrote: ... By the way, any idea how different the MayaVi interface is? I understand that matplotlib doesn't do 3D plots and I may want to plot some. ... Hey Esmail, there was the possibility for 3D plots in matplotlib: http://www.scipy.org/Cookbook/Matplotlib/mplot3D however, the mayavi mlab interface was designed explicitly to be as simple as pylab. http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab.html have fun 3D plotting, sebastian. signature.asc Description: OpenPGP digital signature -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] one data set, two y axis scales
Jae-Joon Lee wrote: ... def Tc(Tf): return (5./9.)*(Tf-32) ax1 = subplot(111) # y-axis in F ax2 = twinx() # y-axis in C def update_ax2(ax1): y1, y2 = ax1.get_ylim() ax2.set_ylim(Tc(y1), Tc(y2)) # automatically update ylim of ax2 when ylim of ax1 changes. ax1.callbacks.connect(ylim_changed, update_ax2) ax1.plot([78, 79, 79, 77]) ... Thanks, this was also useful for me. I see that you are discussing shortcomings of twinx -- so perhaps the following is one of those... I was using this exact script with an additional ax1.set_yscale('log') ax2.set_yscale('log') and the ticks seem to be messed up. I used 'ipython -pylab' with matplotlib.__version__ '0.98.3'. Is there something I can do to get the ticks only at the places i would like them to be? Thanks, Sebastian. signature.asc Description: OpenPGP digital signature -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] EMF export doesn't work
Thomas Pfaff wrote: ... ImageMagick just puts a bitmap representation of the image into the EMF-file ... I want ... vectors, though. hey thomas! i see. perhaps xfig could then help you, it has an export to emf feature (and can import ps files, see for example http://www.thamnos.de/computer-corner/latex/ ). and at least when exporting pdf files, they are in a vector format. best, sebastian. signature.asc Description: OpenPGP digital signature -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] contour overlapping
Armin Moser wrote: Sebastian Busch wrote: ... array([list(a[i,:i])+list(b[i,i:]) for i in range(a.shape[0])]) It seems that I did not understand what you tried to reach. ... Sorry. I wanted to do the same as Matthias -- taking his example: = from scipy import ones, array matrix1 = ones((4,4)) matrix2 = 2*ones((4,4)) matrix3 = array([list(matrix1[i,:i])+list(matrix2[i,i:])\ for i in range(matrix1.shape[0])]) = yields matrix3 array([[ 2., 2., 2., 2.], [ 1., 2., 2., 2.], [ 1., 1., 2., 2.], [ 1., 1., 1., 2.]]) it's quite the same, you just have to type less :) best, sebastian. signature.asc Description: OpenPGP digital signature -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] contour overlapping
Matthias Michler wrote: ... for i in xrange(len(matrix3[:, 0])): # all rows for j in xrange(len(matrix3[0, :])):# all columns ... if your matrices a and b are rectangular (and i think the diagonal makes only sense in this case), you can also say: array([list(a[i,:i])+list(b[i,i:]) for i in range(a.shape[0])]) best, sebastian. p.s.: i think it would be a nice feature to put matplotlib-users@lists.sourceforge.net as reply-to in the mails distributed via the list -- i keep hitting the 'reply'-button and wonder why my mails do not show up in the list... signature.asc Description: OpenPGP digital signature -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with usetex \color
Hey Jae-Joon! Thank you for your answer! Jae-Joon Lee wrote: ...your example will show you a correct color if you save it as ps... Indeed the ps output is colored! That's great :) ... describe where you intend to use multi-color text ... OK, you got me -- actually, this was already a hack. My problem is that I have labels which read something like d = 12m where the number varies within ]0, 20[. I would have liked to get an aligned legend, like d = 9m d = 10m In order to achieve that, i was trying to print a white (=invisible) 1 whenever the number was smaller than 10 as spaceholder (I do not want to use a monospaced font). Obviously, this doesn't work any more as soon as you reach 20... Thanks again for the help -- I'm happy for the moment, but if you (or someone else) can show me how to align the legend, it would be great. Best wishes, Sebastian. signature.asc Description: OpenPGP digital signature -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with usetex \color
Hey Matthias! Thanks for working on that! Matthias Michler wrote: ... I'm not sure that following problem also occurs for Sebastian, ... it does. ... PS-backend ... the upper part of the b is somehow hidden ... f.text(0.5, 0.5, r{\color[rgb]{0,1,0} a } b {\color{blue} $\nu, \mu, \tau$}) In addition to that, I have the strange behaviour that the b is not displayed at all when using f.text(0.5, 0.5, r{\color[rgb]{0,1,0} a } b) -- gives only a green a but it is without the color command: f.text(0.5, 0.5, r{ a } b) -- gives black a b Pretty weird, isn't it? Best, Sebastian. signature.asc Description: OpenPGP digital signature -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users