[Matplotlib-users] text height without ascender and descender
Is it possible to teach matplotlib to calculate text heights without ascender and descender? If I use a comma to print decimal values (german notation) it looks awful but the center of gravity is not the median. Matplotlib use the center of the full text height (included ascender and descender height) -- View this message in context: http://old.nabble.com/text-height-without-ascender-and-descender-tp31256627p31256627.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] 3d Surface-Contour Plot
On Mon, Mar 14, 2011 at 9:05 AM, herbie13 g.h.herb...@dur.ac.uk wrote: Hello, I basically have a Chi-Squared distribution that is dependent on 3 variables. eg. X2(x, y, z) What I would like to do is be able to plot the chi-squared + 1 surface in 3-dimensions. eg. I would like to have the three axes as x, y and z. and then have a surface (its going to look like a closed blob effectively) that maps the chi-squared plus one surface. I have no idea how to do this though. Is it possible? any ideas? I think matplotlib is relatively limited in its 3D capabilities. I would suggest trying Mayavi2 with a contour3d[1] or a volume[2,3]. Look here[4] for many examples. [1] http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#enthought.mayavi.mlab.contour3d [2] http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_chemistry.html#example-chemistry [3] http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_protein.html#example-protein [4] http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/examples.html -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] using matplotlib on a server
Hi, I am trying to use matplotlib on a server which I don't run without it installed. I tried untarring it to a folder in the path of PYTHONPATH and using it directly without any luck. Has anyone successfully installed matplotlib and its dependencies under a user account? Cheers, -- PMatos -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matplotlib is slow
Hello everyone, I would like to draw the attention on the slow startup of matplotlib. Indeed, running matplotlib takes a long time. I performed the following sequence : ```bash #!/bin/bash for i in * ; do python2 -c from temp import * ; plot_(\${i}\) ; done ``` with temp.py like this : ```python #!/usr/bin/env python2 import sys import matplotlib.pyplot as plt import read_data as rd import numpy def plot_( fname ): P,I = rd.read_data(fname) Iprime = [ l / k for k , l in zip( numpy.diff(P) , numpy.diff(I) ) ] fig = plt.figure() ax1 = fig.add_subplot(211) ax2 = fig.add_subplot(212) ax1.plot(P,I) ax2.plot(P[:-1],Iprime) fig.savefig( fname + .pdf, format='pdf' ) ``` And it seems the longer operation is to import matplotlib.pyplot. Does something could be done to improve the loading time of this module ? Thank you very much. greatings, David Kremer -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] using matplotlib on a server
On Mon, Mar 28, 2011 at 8:19 AM, Paulo J. Matos pocma...@gmail.com wrote: Hi, I am trying to use matplotlib on a server which I don't run without it installed. I tried untarring it to a folder in the path of PYTHONPATH and using it directly without any luck. Has anyone successfully installed matplotlib and its dependencies under a user account? Sure, that's not particularly difficult. But untarring won't be enough. You also have to build it. We'd need to know more about your platform to help, but basically: install the dependencies and then run python setup.py install --prefix=~/mylocal On ubuntu and similar, you can get the build dependencies by first doing sudo python setup.py build_dep python-matplotlib See http://matplotlib.sourceforge.net/users/installing.html For running on a web app server, see also http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server JDH -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib is slow
I would recommend running the import in the Python profiler to determine where most of the time is going. When I investigated this a few years back, it was mainly due to loading the GUI toolkits, which are understandably quite large. You can avoid most of that by using the Agg backend. If you're using the Agg backend and still experiencing slowness, it may be that load-up issues have crept back into matplotlib since then -- but we need profiling data to figure out where and how. Mike From: David Kremer [david.kremer...@gmail.com] Sent: Monday, March 28, 2011 9:36 AM To: Matplotlib Users Subject: [Matplotlib-users] matplotlib is slow Hello everyone, I would like to draw the attention on the slow startup of matplotlib. Indeed, running matplotlib takes a long time. I performed the following sequence : ```bash #!/bin/bash for i in * ; do python2 -c from temp import * ; plot_(\${i}\) ; done ``` with temp.py like this : ```python #!/usr/bin/env python2 import sys import matplotlib.pyplot as plt import read_data as rd import numpy def plot_( fname ): P,I = rd.read_data(fname) Iprime = [ l / k for k , l in zip( numpy.diff(P) , numpy.diff(I) ) ] fig = plt.figure() ax1 = fig.add_subplot(211) ax2 = fig.add_subplot(212) ax1.plot(P,I) ax2.plot(P[:-1],Iprime) fig.savefig( fname + .pdf, format='pdf' ) ``` And it seems the longer operation is to import matplotlib.pyplot. Does something could be done to improve the loading time of this module ? Thank you very much. greatings, David Kremer -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] ramp shaped bars?
Would you mind filing a bug for this in the issue tracker? https://github.com/matplotlib/matplotlib/issues Mike From: Jim Ford [jford14...@gmail.com] Sent: Friday, March 25, 2011 11:25 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] ramp shaped bars? Well, what do you know? For once, the call of the noob, Hey! there must be a bug speaks truth. Thanks, Angus! I added a little code to duplicate the last point until the array length is at least 5, and everything looks just fine. On 03/25/2011 01:10 PM, Angus McMorland wrote: On 25 March 2011 07:31, jford14685jford14...@gmail.com wrote: I am a newbie Python programmer trying to make 3d barplots like http://matplotlib.sourceforge.net/examples/mplot3d/bars3d_demo.html this one on the Matplotlib site. When I run the demo source (python bars3d_demo.py) it works fine. I then changed the way xs and ys are assigned, to xs = np.array([1.,2.,3.]) # was xs = np.arange(20) ys = np.array([1.,2.,3.]) # was ys = np.random.rand(20) ax.bar(xs, ys, zs=1, zdir='y', color='r', alpha=0.8) (ditto for two other data sets) Now the bars are triangles. The right side of each bar is of the correct height, but the left side of each bar starts at zero. Here's another data point. My guess is this is a bug with Axes3D: I can recreate the problem with 3 bars, but with4 bars everything works okay. On my setup, with exactly 4 bars, the leftmost edge of the bars doesn't get a border, so something possibly related is going on there too. Angus. -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] usetex = True + eps output - letters are only curves
Set the ps.fonttype to 42, which will embed the entire font. ps.fonttype = 3 (the default) subsets the font to only the characters used in the plot, and stores them as curves for maximum portability. Mike From: Lebostein [lebost...@gmx.de] Sent: Friday, March 25, 2011 5:30 PM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] usetex = True + eps output - letters are only curves Hi, if I create an eps from a matplotlib chart with matplot.rc('font', size=fsize, family='serif', serif='Computer Modern Roman') matplot.rc('text', usetex = True) matplot.rc('text.latex', unicode = True) then I can't mark the letters in eps viewer. And I can't search for letters and words in the eps. It seems, the letters are curves in the eps. Why? If I create a pdf, I can mark letters and words an I can search too. How I can create an eps output with embedded font and real letters? -- View this message in context: http://old.nabble.com/usetex-%3D-True-%2B-eps-output--%3E-letters-are-only-curves-tp31242096p31242096.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib figures missing text
It could be that matplotlib is not finding any fonts on your system for some reason. It would be useful to know whether any of the examples on the matplotlib website work for you, or it is something specific to your plot code. Do you have any non-default settings in your matplotlibrc? Mike From: Andre' Walker-Loud [walksl...@gmail.com] Sent: Thursday, March 24, 2011 7:54 PM To: Michael Droettboom Cc: Matplotlib Users Subject: Re: [Matplotlib-users] matplotlib figures missing text Hi Michael, In both cases, I was first hoping someone else has experienced this problem, to know I am not alone in the universe. But since you asked, I am using the macosx backend - but find the same problem also with WXAgg and TkAgg. When you mention included examples, I do not find any in my /Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/mpl-data/example/ folder. Do you mean ones I find on the web at the matplotlib site? Thanks, Andre On Mar 24, 2011, at 4:31 PM, Michael Droettboom wrote: On 03/24/2011 09:35 AM, Andre' Walker-Loud wrote: Hi All, I am having two slight irritating issues making figures with matplotlib (and have not found a solution with Google) I am running the Enthought 6.2 distribution (python 2.6, matplotlib 0.99.3, ipython 0.10, ...) which is installed as a Framework on a Mac OSX 10.6 platform. I currently am using (matplotlibrc file) backend : macosx (I find the same issues with WXAgg and TkAgg as well) ... text.usetex : true #use latex for all text handling Both problems began with my Enthought distribution (but for reasons I will spare you, I don't want to switch to a different installation if possible, except upgrade Enthought). Problem 1: With all my old installations, which existed on previous Mac OSX version (10.5), I did not need to set text.usetex : true #use latex for all text handling My text rendering worked fine. But with the Enthought version, for some reason, I got fatal errors. So I switched to having latex render all text. This wasn't a big deal, and it has been a while, so I don't have the error logs anymore. Just wondering if anyone else experienced this, and understands why? Without seeing the content of the error, it's very hard to say why it might be failing. Can you set text.usetex back to False and send us the error output? Problem 2: (I believe unrelated to 1) I use the annotate command to add text to my figures, displaying analysis results. Frequently, when I save the figure as a PDF, these annotated texts do not appear in the saved PDF. I find that if I fiddle with the matplotlib gui figure-window, adjusting the size on my screen, then I can eventually get the saved PDF to contain this text. But this gets very annoying quickly, as almost never is the default size the one needed to properly capture the text in the saved figure, and it requires lots of fine-tuning with trial and error. If I instead save as PNG, I almost never have this problem (maybe never). Infrequently, the text doesn't even display in the gui window, until I fiddle with the size of the window. In both cases, NO errors are produced. My script which does the analysis and produces the figures uses from pylab import * but otherwise no * imports. My old Fink installation doesn't have this problem - but it was moved from my old Mac OSX 10.5 system, and there are some issues with the upgrade to Mac OSX 10.6, which lead me to need to just re-install everything fresh on the 10.6 OS. I am not sure if this problem is specific to Enthought's distribution (the latex tex rendering problem made me suspect this) or is just some bizarre Mac problem or ??? So, does anyone out there have the same or similar problem? And better yet, understand why and how to fix? Which backend are you using? Can you provide a standalone plot that produces the error? Do any of the included examples (particularly those related to annotate) fail for you? Mike From: Andre' Walker-Loud [walksl...@gmail.com] Sent: Thursday, March 24, 2011 12:35 PM To: Matplotlib Users Subject: [Matplotlib-users] matplotlib figures missing text Hi All, I am having two slight irritating issues making figures with matplotlib (and have not found a solution with Google) I am running the Enthought 6.2 distribution (python 2.6, matplotlib 0.99.3, ipython 0.10, ...) which is installed as a Framework on a Mac OSX 10.6 platform. I currently am using (matplotlibrc file) backend : macosx (I find the same issues with WXAgg and TkAgg as well) ... text.usetex : true #use latex for all text handling Both problems began with my Enthought distribution (but for reasons I will spare you, I don't want to switch to a different installation if possible, except
[Matplotlib-users] How to set the number of digits of the ticks?
Hello all I am tryint to plot the ticks in scientific notation, and I would like to set the tick size to 2 digits (i.e. 0.5 x e-7). Instead, I am either loosing the scientific notation or getting the scientific notation with a number of too many decimal positions. The problem is that my numbers are of e-7 order and if I just try to round the number of decimal positions, I get a value of 0.0... Here's my script majorLocator = MultipleLocator(PSD_2z.max()/3.0) majorformatter = FormatStrFormatter('%1.1e') # or (%0.1f) ax1 = fig.add_subplot(511) ax1.ticklabel_format(style='sci',scilimits=(0,0), axis='y') ax1.yaxis.set_major_locator(MultipleLocator(ax1.get_ylim()[1]/3.0)) ax1.yaxis.set_major_formatter(majorformatter) Thanks for your help! -- View this message in context: http://old.nabble.com/How-to-set-the-number-of-digits-of-the-ticks--tp31250240p31250240.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] import error of affine_transform from matplotlib._path
Hello there I am trying to put together matplotlib-1.0.1-win32-py2.6, numpy-1.5.1-win32-superpack-python2.6 and scipy-0.9.0rc1-win32-superpack-python2.6 for py2.6.6. When I run my file through eclipse I get this error: Traceback (most recent call last): File C:\Documents and Settings\Colby Student\Desktop\fungi\src\display.py, line 8, in module import pylab as pl File C:\Python26\lib\site-packages\pylab.py, line 1, in module from matplotlib.pylab import * File C:\Python26\lib\site-packages\matplotlib\pylab.py, line 220, in module from matplotlib import mpl # pulls in most modules File C:\Python26\lib\site-packages\matplotlib\mpl.py, line 1, in module from matplotlib import artist File C:\Python26\lib\site-packages\matplotlib\artist.py, line 6, in module from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath File C:\Python26\lib\site-packages\matplotlib\transforms.py, line 34, in module from matplotlib._path import affine_transform ImportError: DLL load failed: The system cannot find the file specified. How can I deal with it? Please, help :-( -- View this message in context: http://old.nabble.com/import-error-of-affine_transform-from-matplotlib._path-tp31241831p31241831.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib.test() no errors, but $nosetest matplotlib.tests - errors and failure?
Blast from the past! I just ran into this and it comes from the fact that 'matplotlib.tests.test_text' is not in the default_test_modules variable inside matplotlib's __init__.py Here's the necessary diff: index 82633a5..649e4d8 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -968,7 +968,8 @@ default_test_modules = [ 'matplotlib.tests.test_spines', 'matplotlib.tests.test_image', 'matplotlib.tests.test_simplification', -'matplotlib.tests.test_mathtext' +'matplotlib.tests.test_mathtext', +'matplotlib.tests.test_text' ] I added a pull request for this two line change just in case there was a specific reason to *exclude* test_text from the test modules? For instance, right now, I get one failure in the test suite if I include it. The failure is in test_text:test_font_styles, but this has been the case for a while, it's just that these tests weren't running before. Any developers want to chime in on this? best, -- Paul Ivanov http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 Michael Droettboom, on 2010-07-27 11:19, wrote: Hmm... surprisingly, I am actually able to reproduce this sort of behaviour here. I'll look into it further. Mike On 07/27/2010 09:49 AM, Michael Droettboom wrote: Of course, we'll prefer to see all of the tests pass... I'm surprised the two modes of running the tests gives different results. Are you sure they are running the same python? Does python `which nosetests` matplotlib.tests give you the same result as nosetests matplotlib.tests ? There must be some environmental difference between the two to cause the different results. Mike On 07/24/2010 05:09 PM, Adam wrote: Hello, I have just updated to v1.0.0 and am trying to run the test suite to make sure everything is ok. There seems to be two different suites and I am not sure which is correct/current: $python -c 'import matplotlib; matplotlib.test()' [...snipped output...] Ran 138 tests in 390.991s OK (KNOWNFAIL=2) $nosetests matplotlib.tests I get: [...snipped output] Ran 144 tests in 380.165s FAILED (errors=4, failures=1) Two of these errors are the known failures from above, and the other two are in matplotlib.tests.test_text.test_font_styles: ImageComparisonFailure: images not close: /home/adam/result_images/test_text/font_styles.png vs. /home/adam/result_images/test_text/expected-font_styles.png (RMS 23.833) ImageComparisonFailure: images not close: /home/adam/result_images/test_text/font_styles_svg.png vs. /home/adam/result_images/test_text/expected-font_styles_svg.png (RMS 12.961) The module that fails is: FAIL: matplotlib.tests.test_mlab.test_recarray_csv_roundtrip -- Traceback (most recent call last): File /usr/local/lib/python2.6/dist-packages/nose-0.11.4-py2.6.egg/nose/case.py, line 186, in runTest self.test(*self.arg) File /usr/local/lib/python2.6/dist-packages/matplotlib/tests/test_mlab.py, line 24, in test_recarray_csv_roundtrip assert np.allclose( expected['x'], actual['x'] ) AssertionError I am not sure of the importance level of these - but I wanted to ask to see if I should do anything or if they can safely be ignored. Thanks, Adam. signature.asc Description: Digital signature -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Polar grid below/behind the plot
Dear Forum, I want to send the polar grid lines (circles and radial lines) behind the plot. How can I do that? I tried other options but unable to do so. Here, I am taking matplotlib example. Please get back to me on this. Thanks!!! Example: polar_demo.py import matplotlib import numpy as np from matplotlib.pyplot import figure, show, rc, grid # radar green, solid grid lines rc('grid', color='#316931', linewidth=1, linestyle='-') rc('xtick', labelsize=15) rc('ytick', labelsize=15) # force square figure and square axes looks better for polar, IMO width, height = matplotlib.rcParams['figure.figsize'] size = min(width, height) # make a square figure fig = figure(figsize=(size, size)) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c') r = np.arange(0, 3.0, 0.01) theta = 2*np.pi*r ax.plot(theta, r, color='#ee8d18', lw=3) ax.set_rmax(2.0) grid(True) ax.set_title(And there was much rejoicing!, fontsize=20) show() -- View this message in context: http://old.nabble.com/Polar-grid-below-behind-the-plot-tp31250845p31250845.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Changing labels to time
Hello all, i have certain dates that i want to use as the xlabels, i have looked around but found nothing i can use. I get the date from the netcdf file in a format something like a timestamp, like: 16216 that i turn into 04:30:16 I want to know how can i use this as a label. Thx in advance -- View this message in context: http://old.nabble.com/Changing-labels-to-time-tp31260038p31260038.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] get bboxes of bars in data coordinates
I need to get the bboxes for time-range bars (matplotlib.patches.Rectangle objects) on a bar plot for a custom autoscaling function. Right now, I get them like this, where rectObj = a bar and bboxes = a list of bboxes: bboxes.append(rectObj.get_path().get_extents()) print 'bboxes is: ', bboxes However, the print shows bboxes to be: bboxes is: [Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]])), Bbox(array([[ 0., 0.], [ 1., 1.]]))] This is not what I need, because these points have nothing to do with the y axis I'm scaling (in fact, what do they mean?). Instead, I need bboxes that look more like this: bboxes is: [Bbox(array([[ 734190.02541214, 730844.2917], [ 734223.88252666, 730844.375 ]]))] (Although this is from getting the bboxes from a line, not a set of bars) These are in the floating point version of a date, which is what the y axis is scaled in. How can I get the bboxes of these bars in those coordinates? Thanks, Che -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] get bboxes of bars in data coordinates
I should add, I can see that (I think) this needs to use a transform to get it in data coordinates, because if I do this to each rectObj (each bar): trans = rectObj.get_patch_transform() print 'trans is: ', trans I get: trans is: BboxTransformTo(Bbox(array([[ 734189.52541214, 730844.], [ 734190.52541214, 730844.]]))) Which shows the data-coordinate bboxes in there, but that's now a BboxTransformTo object, not a Bbox object. I'm just don't know what method turns a display-coordinate bbox into a data-coordinate bbox. Thanks, Che -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Plot show() errors, Mac OS 10.6
operating system $ uname -a Darwin nate-gallaghers-macbook-pro.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 matplotlib version: matplotlib-1.0.1-python.org-32bit-py2.7-macosx10.3.dmg obtained from: http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/ no customizations to matplotlibrc $ python simple_plot.py --verbose-helpful $HOME=/Users/ibook CONFIGDIR=/Users/ibook/.matplotlib matplotlib data path /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data loaded rc file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc matplotlib version 1.0.1 verbose.level helpful interactive is False units is False platform is darwin Using fontManager instance from /Users/ibook/.matplotlib/fontList.cache backend TkAgg version 8.5 findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 0.00 Exception in Tkinter callback Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py, line 1410, in __call__ return self.func(*args) File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py, line 245, in resize self.show() File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py, line 249, in draw tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/tkagg.py, line 19, in blit tk.call(PyAggImagePhoto, photoimage, id(aggimage), colormode, id(bbox_array)) TclError -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] get bboxes of bars in data coordinates
On Mon, Mar 28, 2011 at 1:44 PM, C M cmpyt...@gmail.com wrote: I need to get the bboxes for time-range bars (matplotlib.patches.Rectangle objects) on a bar plot for a custom autoscaling function. Right now, I get them like this, where rectObj = a bar and bboxes = a list of bboxes: bboxes.append(rectObj.get_path().get_extents()) print 'bboxes is: ', bboxes OK, I have it... Because I was using the above to get the bbox for a Line2D object, I didn't realize there was already a method to get the bbox (in data coordinates) from a Rectangle: rectObj.get_bbox() -Che -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users