[Matplotlib-users] Best way to plot a 2d histogram?

2009-10-01 Thread Ernest Adrogué
Hello all, What is the best way to plot a 2d histogram? (Note that a 2d histogram is a histogram of a bivariate variable, so it's got to be a 3d plot.) Ideally, it should look somewhat like this: http://www.desy.de/~mraue/public/rootTutorial/v0.2/histogram02.gif For now, I have tried to do surfa

Re: [Matplotlib-users] Best way to plot a 2d histogram?

2009-10-02 Thread Ernest Adrogué
Hi, 1/10/09 @ 19:23 (-0500), thus spake Gökhan Sever: > Although it is not an exact histogram, if you are you looking for a > Pythonic alternative you might consider using Mayavi. It has ready > barchart plotting functionality. Probably with some effort a 2D > histogram as you linked might be cre

Re: [Matplotlib-users] Best way to plot a 2d histogram?

2009-10-02 Thread Ernest Adrogué
Hi, 1/10/09 @ 18:17 (-0700), thus spake Matthew Neeley: > Here is a snippet that might get you started: > > > import numpy as np > from matplotlib import pyplot as plt > from matplotlib import cm > import mpl_toolkits.mplot3d as plt3 > > data = np.random.random((8,8))**4 > cmap = cm.RdBu > >

[Matplotlib-users] unfilled scatter points

2009-10-05 Thread Ernest Adrogué
hi, is it possible to draw unfilled scatter points? i want to use an unfilled 'o' marker with a dashed border to represent the 'expected' data, as opposed to the observed data. i can make the border dashed but haven't figured out how to make the marker not filled. any idea? thanks! -- Ernest --

[Matplotlib-users] Axes.bar(orientation='horizontal') doesn't work?

2009-10-06 Thread Ernest Adrogué
Hi, I'm trying to plot some horizontal bars using the .bar() method: import matplotlib.pyplot as plt fig=plt.figure() ax=fig.add_subplot(1,1,1) ax.bar([1,2,3],[4,6,5],orientation='horizontal') raises an AssertionError: AssertionErrorTraceback (most recent call last)

Re: [Matplotlib-users] hierarchical coloring of nodes

2009-10-08 Thread Ernest Adrogué
1/10/09 @ 12:21 (-0500), thus spake Srivathsan Srinivas: > Hi, >I am trying to plot a graph and color nodes in a loop. So far, the > for-loop I am using can color them. But, I am able to color them using a > single color. I want to color the nodes differently for each iteration of > the for-lo

[Matplotlib-users] unclutter the axis

2009-10-12 Thread Ernest Adrogué
hi, is there a way to put a label every two o three ticks, instead of putting it on every tick? the following works but it's a little cumbersome: ax.set_yticklabels([pos % 2 != 0 and '%.2f' % num or '' for pos, num in enumerate(ax.get_yticks())]) cheers, Ernest --

Re: [Matplotlib-users] plotting from within ipython, and then go on in the shell calculations

2009-10-13 Thread Ernest Adrogué
14/10/09 @ 02:38 (+0200), thus spake qu...@gmx.at: > okay. don't shoot me > > you need to start ipython with: > >ipython -pylab > or alternatively, start ipython normally, import matplotlib.pyplot and then call matplotlib.pylot.ion() which turns the 'interactive mode' on. then when you cre

Re: [Matplotlib-users] plotting from within ipython, and then go on in the shell calculations

2009-10-14 Thread Ernest Adrogué
13/10/09 @ 14:35 (-1000), thus spake Eric Firing: > Ernest Adrogué wrote: > >14/10/09 @ 02:38 (+0200), thus spake qu...@gmx.at: > >>okay. don't shoot me > >> > >>you need to start ipython with: > >> > >> ipython -pylab &

[Matplotlib-users] sharing the x-axis with another plot's y-axis

2009-10-26 Thread Ernest Adrogué
Hi, I know about sharing an axis with another subplot, but is it possible to share the x-axis with another subplot's y-axis (or the other way around)? Thanks. Ernest -- Come build with us! The BlackBerry(R) Developer Conf

Re: [Matplotlib-users] axis on top for barh plot

2009-11-28 Thread Ernest Adrogué
28/11/09 @ 00:17 (+0100), thus spake Mike Anderson: > Hi, > > How can I put the bottom axis on top (or on top AND on bottom) for a barh > plot? > > I'm trying to mimic this, made with gnuplot: > > http://www.hep.wisc.edu/cms/comp/cmsprod/dCacheUserUsage.png > > within matplotlib, and I've co

[Matplotlib-users] font rendering quality

2009-11-30 Thread Ernest Adrogué
Hi, I notice a big difference in quality between the text rendered by matplotlib and that rendered by the rest of applications. As an example, see the image attached showing the same font as shown by firefox and matplotlib respectively. Is there any config setting I can change to improve the font r

Re: [Matplotlib-users] font rendering quality

2009-12-01 Thread Ernest Adrogué
30/11/09 @ 22:28 (-0600), thus spake John Hunter: > The two examples in the page you link to have different font sizes and > possibly different font weights, which makes it difficult to do > side-by-side comparisons. Could you post an example with > similar/identical settings? Yes, I have attache

Re: [Matplotlib-users] font rendering quality

2009-12-01 Thread Ernest Adrogué
1/12/09 @ 09:16 (-0500), thus spake Michael Droettboom: > Subpixel rendering is almost never what you want when producing a > PNG file, since it is likely to be shared on a different machine > requiring different subpixel settings. But it looks like your > mozilla example is not using subpixel re

[Matplotlib-users] how to add text below the legend

2010-01-31 Thread Ernest Adrogué
Hi, I would like to add some text relative to the legend, let's say below it, and I don't know how to get the legend coordinates so I can pass them to the text() method. Does anyone know how to do it? Alternatively, if there was a way to add text inside the legend itself, it would also do the tr

Re: [Matplotlib-users] how to add text below the legend

2010-02-03 Thread Ernest Adrogué
ldren().append(txt) > box.set_figure(box.figure) > > For more control of legend, see the link below. > > http://abitofpythonabitofastronomy.blogspot.com/2010/01/customized-legend.html Thanks Jae-Joon. Your solution has worked like a charm. > Regards, > > -JJ > >

[Matplotlib-users] how to make an axis labels visible in axes_grid?

2010-02-08 Thread Ernest Adrogué
Hi, I have an AxesGrid instance of 2x2 subplots. I actually only want 3 subplots, so I instantiate AxesGrid with the add_all=False option, and manually add only the first 3 axes to the figure: import matplotlib as plt from mpl_toolkits import axes_grid f = plt.figure() grid = axes_grid.AxesGrid(

Re: [Matplotlib-users] x,y ticklabel too close

2010-02-11 Thread Ernest Adrogué
Hi, 11/02/10 @ 12:40 (-0500), thus spake Filipe Pires Alvarenga Fernandes: > Hello list, > > For the following plotI using a large font for the tick-label that causes > the first x,y tick-labels to overlap > > http://yfrog.com/5zimageykp > > for now I'm padding spaces to "fix" the plot, like th

Re: [Matplotlib-users] DateFormatter + Latex issue

2010-02-16 Thread Ernest Adrogué
15/02/10 @ 19:22 (-0500), thus spake Filipe Pires Alvarenga Fernandes: > Hello list, > > If I use DateFormatter with latex and lines breaks like this > >>> DateFormatter("\n \n %b") I get an latex error: > > http://pastebin.com/m5b186ded > > Although, if I do not use the line breaks, > >>> DateF

Re: [Matplotlib-users] DateFormatter + Latex issue

2010-02-16 Thread Ernest Adrogué
16/02/10 @ 09:03 (-0500), thus spake Filipe Pires Alvarenga Fernandes: > Thanks Ernest, I had no idea that the DateFormatter was going to be treated > as latex as well. Yes, all strings are processed by LaTeX. > > However, escaping the \ with another \ did not worked. > I tried: > > majorF = D

Re: [Matplotlib-users] DateFormatter + Latex issue

2010-02-16 Thread Ernest Adrogué
16/02/10 @ 16:20 (-0500), thus spake Filipe Pires Alvarenga Fernandes: > "\\" works for titles and label, but not for DateFormatter, but \vspace did > the trick! > > Thanks again for the help. > > ps: I'm new to python, but maybe there is a way to mix Latex and unicode? Yes, the inputenc packag

Re: [Matplotlib-users] DateFormatter + Latex issue

2010-02-16 Thread Ernest Adrogué
Hi, 16/02/10 @ 17:01 (-0500), thus spake Jae-Joon Lee: > On Tue, Feb 16, 2010 at 4:05 PM, Ernest Adrogué wrote: > > \vspace{10pts} does insert whitespace, however I am not sure if > > it's the proper way of doing it... > > > > Can you (or someone else) confir