Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-29 Thread Jae-Joon Lee
I did some refactoring and now the annotation is also draggable.. I also added an example, examples/animation/draggable_legend.py Regards, -JJ On Fri, Jan 29, 2010 at 10:28 AM, John Hunter wrote: > On Thu, Jan 28, 2010 at 10:14 PM, Fernando Perez wrote: >> On Thu, Jan 28, 2010 at 8:01 PM, C

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-29 Thread Jae-Joon Lee
added blitting support. -JJ On Fri, Jan 29, 2010 at 12:40 PM, Jae-Joon Lee wrote: > I did some refactoring and now the annotation is also draggable.. > I also added an example, > > examples/animation/draggable_legend.py > > Regards, > > -JJ > > > > On Fri, J

Re: [Matplotlib-users] Label picker broken?

2010-02-01 Thread Jae-Joon Lee
Current "pick" implementation explicitly checks if the event is inside the axes. So, you cannot pick artists outside the axes area. This seems more like an intended "feature" than a bug, but I may be wrong. And my guess is that this is to prevent picking invisible artists (as they are clipped). Wh

Re: [Matplotlib-users] AXES properties

2010-02-01 Thread Jae-Joon Lee
Are you using the axes_grid toolkit? Standard matplotlib axis instance does not have "major_ticklabels" attribute, while axes_grid axis does. Please post a simple, but complete example that can be run and tested. Regards, -JJ On Sun, Jan 31, 2010 at 11:06 AM, wrote: > BTW: I tried to use set_

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

2010-02-01 Thread Jae-Joon Lee
See if the example below works. plot([1,2,3], label="test") a=legend() import matplotlib.offsetbox as offsetbox txt=offsetbox.TextArea("Test 2") box = a._legend_box box.get_children().append(txt) box.set_figure(box.figure) For more control of legend, see the link below. http://abitofpythonabito

Re: [Matplotlib-users] How to calculate relative positions between objects

2010-02-01 Thread Jae-Joon Lee
Here is a slightly revised version of your script. It has a separate axes for labeling whose width is determined by the maximum width of the labels (using MaxExtent from axes_grid toolkit). Give it a try and see if it fits your needs. Regards, -JJ import numpy as np import matplotlib.pyplot as

Re: [Matplotlib-users] Label picker broken?

2010-02-01 Thread Jae-Joon Lee
On Mon, Feb 1, 2010 at 4:30 PM, Ben Axelrod wrote: > This still seems like a regression bug to me. Especially since > matplotlib's own example code clearly shows that picking labels, titles, and > tick labels outside the axes region should be possible with the standard > picker. If the current

Re: [Matplotlib-users] AXES properties

2010-02-01 Thread Jae-Joon Lee
plt.figure(**figprops) >   fig.subplots_adjust(**adjustprops) >                  # Tunes the subplot layout > >   host = SubplotHost(fig, 111) > >   p0, = host.plot([0, 1, 2], [0, 1, 2], label="Density") >   ax=host.axis["left"] >   plt.setp(ax.label, visibl

Re: [Matplotlib-users] long legend gets truncated if put outside

2010-02-05 Thread Jae-Joon Lee
On Fri, Feb 5, 2010 at 10:10 AM, Eymen Alyaz wrote: > Is there a way to automatically correct the area of figure and resize it > such that every box drawn is visible? > Things like axes position is given in normalized figure coordinates, thus while you can change the figure size but it is quite h

Re: [Matplotlib-users] clabel manual

2010-02-06 Thread Jae-Joon Lee
This is a known bug, and I think I fixed it in the svn. Meanwhile, you may use the monkey patching. Insert these lines in your script (before you call clabel). Regards, -JJ import matplotlib.blocking_input as blocking_input def mouse_event_stop(self, event ): blocking_input.BlockingInput.po

Re: [Matplotlib-users] clabel manual

2010-02-06 Thread Jae-Joon Lee
JJ, > > Very nice repair, as this works precisely as it should. I use this tool in > Matlab all the time when teaching multivariable calculus. > > D. > > On Feb 6, 2010, at 2:41 PM, Jae-Joon Lee wrote: > >> This is a known bug, and I think I fixed it in the svn. Meanwhile, y

Re: [Matplotlib-users] Using bounds on plot axises. Not clear how this works?

2010-02-07 Thread Jae-Joon Lee
try ax1.axis(v) -JJ On Sun, Feb 7, 2010 at 5:16 PM, Wayne Watson wrote: > The segment below is supposed to plot two columns of (x,y) data and do > it in an area 640x480. Apparently, I'm missing how to use v to get this > done. It dies at col.axis(v) with list object has no attribute 'axis'. >

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

2010-02-08 Thread Jae-Joon Lee
axes_grid uses a custome axes class. See http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axisline For more details, see http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/axislines.html To make ticklabel visible, you may do grid.axes_all[1].axis["botto

Re: [Matplotlib-users] Figure.draw_artist() bug with Text

2010-02-08 Thread Jae-Joon Lee
This is not a bug. The exception is raised simply because "textartist.figure" is None (and it is None because you never set it). "textartist" you created is not properly set up (no figure, no axes, no transform). You may do textartist = Text(0.5, 0.5, "Foo") textartist.set_figure(fig) fig.draw_art

Re: [Matplotlib-users] hatching problem

2010-02-09 Thread Jae-Joon Lee
I cannot reproduce it with Agg backend and ps backend. I tried both svn version and 0.99 maint. version. So, maybe this is a bug in mac os X backend? Do you see a same problem with the ps output? If so, can you post your ouput ps file? Regards, -JJ On Mon, Feb 8, 2010 at 3:26 PM, Tomasz Koziara

Re: [Matplotlib-users] Figure.draw_artist() bug with Text

2010-02-09 Thread Jae-Joon Lee
Figure.draw_artist is just a convenience function. def draw_artist(self, a): """ draw :class:`matplotlib.artist.Artist` instance *a* only -- this is available only after the figure is drawn """ assert self._cachedRenderer is not None a.draw(self.

Re: [Matplotlib-users] trying to Copy plot from one MplWidget canvas to another

2010-02-09 Thread Jae-Joon Lee
Copying a matplotlib canvas (or a figure, or an axes) is not easy. You cannot just rebind it. You need to copy all the hierarchy of underlying artists. Also the attributes of artists need to be adjusted accordingly. And best option in my opinion is just to create another canvas using the code that

Re: [Matplotlib-users] logarithmic plotting and the grid

2010-02-10 Thread Jae-Joon Lee
grid takes an optional argument "which". Unfortunately this is not properly documented with pylab.grid and Axes.grid. But see http://matplotlib.sourceforge.net/api/axis_api.html?highlight=grid#matplotlib.axis.Axis.grid grid(True) # this turns on gridlines for major ticks grid(True, which="minor")

Re: [Matplotlib-users] Ways of updating legends

2010-02-11 Thread Jae-Joon Lee
You're already using "ax.legend", what kind of OO way do you want? Instead of calling plt.legend, you may do ax.legend([s],[str(i)]) Or, if you know what you're doing, you can do leg = ax.legend([s],[''], loc=0) and in the for loop, leg.texts[0].set_text(str(i)) Regards, -JJ On Thu,

Re: [Matplotlib-users] Legend placement on graphs with fill_between

2010-02-11 Thread Jae-Joon Lee
Or, you may fool the algorithm to find the best location by adding invisible lines. For example, axessubplot4.set_autoscale_on(False) l1, = axessubplot4.plot([4, 5], [8, 18]) l1.set_visible(False) axessubplot4.set_autoscale_on(True) Regards, -JJ On Thu, Feb 11, 2010 at 10:58 AM, John Hunter w

Re: [Matplotlib-users] pyplot.yticks ignoring font if labels are supplied, any ideas? SOLVED

2010-02-11 Thread Jae-Joon Lee
On Thu, Feb 11, 2010 at 3:55 PM, ristretto wrote: > I'm not sure I'll ever really understand Matplotlib.  Why I had to do this, > I don't really know.  It's hard to spec out projects when you think that > setting the font on some text should take no time at all, but it takes hours > due to stupid

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

2010-02-11 Thread Jae-Joon Lee
The current matplotlib does not have any automatic way as far as I know (any contribution will be appreciated). On the other hand, instead of explicitly specifying the ticks and ticklabels, you may try to reduce the number of ticks. gca().xaxis.get_major_locator()._nbins=4 Regards, -JJ On Thu

Re: [Matplotlib-users] help with a custom formatter

2010-02-13 Thread Jae-Joon Lee
If you're happy with the default formatter behavior (which seems to match with your #3 requirement), just reuse it. class MyFormatter(ScalarFormatter): def __call__(self, val, pos=None): if val < 0: return '' else: return ScalarFormatter.__call__(self, val)

Re: [Matplotlib-users] figure aspect ratio

2010-02-13 Thread Jae-Joon Lee
On Fri, Feb 12, 2010 at 1:48 PM, Tomasz Koziara wrote: > but then axis labels or even numbering gets cut off. On the other hand > playing with: > You need to manually adjust subplot parameters http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=subplots_adjust#matplotlib.pyplot.subpl

Re: [Matplotlib-users] Placing a marker at specific places where lines join?

2010-02-14 Thread Jae-Joon Lee
On Sat, Feb 13, 2010 at 11:28 PM, Wayne Watson wrote: > Well, I'm not quite sure what to say to your claim. In certain instances I > am trying to get through to someone here that something is missing for > newbies. In one word, pedagogy (as perhaps in a text book, not a reference > manual or dicti

Re: [Matplotlib-users] How to blank an area of the canvas?

2010-02-14 Thread Jae-Joon Lee
I have added a bbox support for "restore_region", but I'm afraid that this feature is not well tested. And I guess what you find is, unfortunately, a bug. While I'll try to push the changes to the svn tomorrow, you may try to monkey-patch with following code. from matplotlib.transforms import Bbo

Re: [Matplotlib-users] turning off tick labels

2010-02-15 Thread Jae-Joon Lee
Try ax1.xaxis.offsetText.set_visible(False) where ax1 is the upper axes. Regards, -JJ On Mon, Feb 15, 2010 at 4:50 AM, Jan Strube wrote: > Hi Jeff, > thanks for your quick reply. > Unfortunately, the line you sent me doesn't have any effect on the plot, > either before or after turning off t

Re: [Matplotlib-users] identification of color bars

2010-02-15 Thread Jae-Joon Lee
Is there any reason that you need to find out which axes is a color bar axes from the list of axes? Can you just keep references to colorbars you create? cbar = colorbar() cax = cbar.ax cax is the axes instance of the colobar you just created. Regards, -JJ On Mon, Feb 15, 2010 at 12:04 PM, Ni

Re: [Matplotlib-users] Arrow question/request

2010-02-15 Thread Jae-Joon Lee
On Mon, Feb 15, 2010 at 2:32 AM, rcnelson wrote: > 1) Are there any plans or would it make sense to add another keyword to the > pyplot.arrow function that allows you to choose the arrow class you would > like to use? The default could be FancyArrow so that the original usage of > pyplot.arrow wil

Re: [Matplotlib-users] Easy come easy go

2010-02-15 Thread Jae-Joon Lee
I cannot reproduce this error both with 0.99.1 maintenance branch and the current svn (with GtkAgg backend). What version of matplotlib and what backend are you using? http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html Regards, -JJ On Sun, Feb 14, 2010 at 11:36 PM, David Arnold wr

Re: [Matplotlib-users] identification of color bars

2010-02-15 Thread Jae-Joon Lee
I hope some other developers can confirm (or dispute) this. For this kind of work, you need to understand some of internals of matplotlib, and I recommend you to go through the matplotlib sources. Regards, -JJ > >  --Nico > > > > On Mon, Feb 15, 2010 at 6:16 PM, Jae-Joon Lee

Re: [Matplotlib-users] identification of color bars

2010-02-16 Thread Jae-Joon Lee
set_colorbar sets colorbar attribute. So I guess you can just check if Mappable.colorbar is None or not. Mappable.colorbar, when set, should be a tuple whose first item is an image for colorbar and the second item is an colorbar axes. Regards, -JJ On Tue, Feb 16, 2010 at 5:26 AM, Nico Schlömer

Re: [Matplotlib-users] identification of color bars

2010-02-16 Thread Jae-Joon Lee
= *snip* == > > How did you find out about the colormap attribute? Was that by taking > a good guess in looking at the source code, or are the public > attributes of a class documented? > > Cheers, > Nico > > > > On Tue, F

Re: [Matplotlib-users] DateFormatter + Latex issue

2010-02-16 Thread 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) confirm this? I don't think "pts" is a proper tex unit and it should be \vspace{10pt}. Maybe this is a typo in

Re: [Matplotlib-users] DateFormatter + Latex issue

2010-02-16 Thread Jae-Joon Lee
If what you want is to have more padding for the major tick labels, I recommend you to use rcParams['xtick.major.pad'] = 20 If you don't like to change the global setting, you may set the ticklabel padding for an specific axis. Try for tck in ax.xaxis.get_major_ticks(): tck.set_pad(20) t

Re: [Matplotlib-users] DateFormatter + Latex issue

2010-02-16 Thread Jae-Joon Lee
On Tue, Feb 16, 2010 at 5:25 PM, Filipe Pires Alvarenga Fernandes wrote: >  I haven't notice the "s" before when using "pts", but what is really > strange is that "pt" does not work! > As I said, it is not supposed to work, because of some technical reason. When there is a single line of text, it

Re: [Matplotlib-users] Color in table help please! I have already searched previous posts

2010-02-16 Thread Jae-Joon Lee
On Tue, Feb 16, 2010 at 2:15 PM, duckman wrote: > I am trying to make the table at the bottom and the lines the same color.  I > took the code from one of the online examples and modified it to do most of > what I want but cannot get the color in the table working properly! Can > someone please he

Re: [Matplotlib-users] Graph gains a blank space at the right hand side

2010-02-23 Thread Jae-Joon Lee
On Mon, Feb 22, 2010 at 11:00 AM, Geoff Bache wrote: > So I guess I have two questions. > 1) Is this a bug? It certainly feels like one... > 2) Is there a workaround / what should I do instead? > Try axessubplot2.autoscale_view(tight=True) Otherwise, you need to manually adjust xlim and ylim.

Re: [Matplotlib-users] Draw only table {without XY Axis}

2010-02-23 Thread Jae-Joon Lee
Try ax = subplot(111, frame_on=False) ax.xaxis.set_visible(False) ax.yaxis.set_visible(False) table(cellText=cellText, colLabels=colLabels) -JJ On Tue, Feb 23, 2010 at 4:06 AM, HUSSAIN BOHRA wrote: > Hi, > > Can any one tell me, How can I draw only a table in a figure (without XY > Cordinates

Re: [Matplotlib-users] Auto-adjusting figure height, imshow equal

2010-02-23 Thread Jae-Joon Lee
On Tue, Feb 23, 2010 at 5:43 AM, Kornél Jahn wrote: > Hi all! > > I am preparing a journal article and the figures should have a fixed width > of 3 inches, with as thin white border around as possible. The figure does > an imshow with equal axes: > My problem is: I do not know in advance the heigh

Re: [Matplotlib-users] How to create customer symbol from PNG file?

2010-02-23 Thread Jae-Joon Lee
markers are vector paths, so I don't think you can use images as markers. But you may overlay your images using imshow. The tricky part is to figure out the extents of the image. You may use OffsetImage http://matplotlib.sourceforge.net/trunk-docs/examples/pylab_examples/demo_annotation_box.ht

Re: [Matplotlib-users] Display Pixel intensity

2010-02-23 Thread Jae-Joon Lee
See http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg13203.html http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg13204.html -JJ On Tue, Feb 23, 2010 at 9:22 AM, Sebastian Rhode wrote: > Hi, > > has anyone a good idea how to interactively display the x

Re: [Matplotlib-users] configuring colorbar labels on a black background

2010-02-23 Thread Jae-Joon Lee
This seems to be a bug and I recommend you to file a bug. This happens because Axis.set_ticklabels method only changes the attributes of left (or bottom) tick labels. Meanwhile, try for t in colorbar.ax.get_yticklabels(): t.set_color("w") -JJ On Tue, Feb 23, 2010 at 11:03 AM, Jim Vickroy w

Re: [Matplotlib-users] PNG images and image area

2010-02-23 Thread Jae-Joon Lee
It is best to create a figure of a right size in the first place. If this cannot be done, try something like below. dpi = 80 fig=figure(1, dpi=dpi) ax = axes((0,0,1,1)) ax.set_aspect(1) from matplotlib.transforms import TransformedBbox, Affine2D w, h = fig.get_size_inches() bbox = TransformedBbo

Re: [Matplotlib-users] Looping through all the built-in colormaps

2010-02-24 Thread Jae-Joon Lee
On Wed, Feb 24, 2010 at 3:06 AM, Matthias Michler wrote: > some time ago somebody proposed an example on the list to circle through all > possible colormaps. In this time cm had an attribute "cm.cmapnames", which > hold all these names, but nowerdays (svn-HEAD) this attribute has be removed > and

Re: [Matplotlib-users] Looping through all the built-in colormaps

2010-02-24 Thread Jae-Joon Lee
On Tue, Feb 23, 2010 at 6:45 PM, David Goldsmith wrote: > 1) why doesn't this: > for cmap in dir(cm):    try:        ax.imshow(image, cmap)        canvas.print_figure('image_'+cmap)    except:        pass > > "work" (i.e., simply bypass those elements of dir(cm) which

Re: [Matplotlib-users] Looping through all the built-in colormaps

2010-02-24 Thread Jae-Joon Lee
On Wed, Feb 24, 2010 at 3:56 AM, David Goldsmith wrote: > cmap='LUTSIZE' does not create an image: it is an invalid value for imshow's > cmap argument.  Many images are created successfully by my loop before > cmap='LUTSIZE' without me calling cla, and Friedrich's soln. works great > w/out me h

Re: [Matplotlib-users] How to increase axis and tick linesize?

2010-02-24 Thread Jae-Joon Lee
> > Not sure how to update these in code yet. Let me know when you figure out :) http://matplotlib.sourceforge.net/users/artists.html#axis-containers >> >>        Also I often find that the xlabel is too close to the plot box >> (xaxis) is there a way to increase this distance besides making my

Re: [Matplotlib-users] TeX and the PDF Backend

2010-02-27 Thread Jae-Joon Lee
I believe it is not just the size of font but the font itself should match. Depending on your setting, the tex file generated by matplotlib include preambles related with font setting. For example, below is mine. \documentclass{article} \usepackage{type1cm} \renewcommand{\rmdefault}{pnc} \usepacka

Re: [Matplotlib-users] Cannot change the fontsize in table.

2010-02-27 Thread Jae-Joon Lee
It seems that you must turn off autoFontsize first. the_table.auto_set_font_size(False) then change th font size. the_table.set_fontsize(10) -JJ On Thu, Feb 25, 2010 at 12:48 PM, afancy wrote: > Hi, > > I want to generate a graph with line, and table at the bottom. However, I > found that th

Re: [Matplotlib-users] Cursor?

2010-02-27 Thread Jae-Joon Lee
Did you try to turn off "useblit" option? As mentioned in the comment, that option is only supported in the agg backend. Regards, -JJ On Thu, Feb 25, 2010 at 10:45 PM, David Arnold wrote: > All, > > I tried this code from:   > http://matplotlib.sourceforge.net/examples/widgets/cursor.py > > fr

Re: [Matplotlib-users] Optimal positioning of text

2010-02-27 Thread Jae-Joon Lee
On Sat, Feb 27, 2010 at 12:29 PM, Andrea Gavana wrote: > This code is not doing anything useful as I always get a badness of 0, > although I can see that the new text overlaps quite a lot of other > artists. > > Does anyone have some suggestion on how to improve the code? > A snippet of code seld

Re: [Matplotlib-users] Optimal positioning of text

2010-02-27 Thread Jae-Joon Lee
but simple(!) code. -JJ On Sat, Feb 27, 2010 at 8:59 PM, Andrea Gavana wrote: > On 28 February 2010 01:18, Jae-Joon Lee wrote: >> On Sat, Feb 27, 2010 at 12:29 PM, Andrea Gavana >> wrote: >>> This code is not doing anything useful as I always get a badness of 0, >&g

Re: [Matplotlib-users] half-filled markers, two-colors

2010-03-01 Thread Jae-Joon Lee
John and T J, L1587 at lines.py def set_mfc(self, val): 'alias for set_markerfacecolor' self.set_markerfacecolor(val, alt=alt) "alt" is not defined and it currently raises an exception. By the way, I noticed that the current approach is to implement fillstyle for EVERY marke

Re: [Matplotlib-users] Polar Photometry Plots?

2010-03-02 Thread Jae-Joon Lee
Do you have any link to an example plot? I googled it but not much luck. Is it like a polar plot without the bottom half? Regards, -JJ On Tue, Mar 2, 2010 at 1:48 AM, R Fritz wrote: > I'd like to be able to generate type C photometry plots with > matplotlib. The standard co-ordinate system for

Re: [Matplotlib-users] Optimal positioning of text

2010-03-02 Thread Jae-Joon Lee
undreds of candidate points for a few cases. No doubt it takes so long. Regards, -JJ On Mon, Mar 1, 2010 at 6:07 AM, Andrea Gavana wrote: > Hi Jae-Joon & All, > > On 28 February 2010 03:09, Jae-Joon Lee wrote: >> If I read your correctly, >> >>       for l, b in zip(x, y

Re: [Matplotlib-users] Polar Photometry Plots?

2010-03-02 Thread Jae-Joon Lee
."  It's a quadrant > rather than a full circle, and it's clipped to a box, but it's still a > polar plot. > > The only problem I have with what matplotlib does is that it seems > determined to put zero at the right, rather than at the bottom.  I want > to turn th

Re: [Matplotlib-users] error, when calling "ax.redraw_in_frame()"

2010-03-03 Thread Jae-Joon Lee
I fixed this in the maintenance branch. But I'm failing with the svnmerge. I thought this issue has been fixed but I'm not sure what I'm doing wrong. I cannot spend much more time on this right now, but John, if you can, please merge the change and commit them for me. Regards, -JJ On Wed, Mar 3

Re: [Matplotlib-users] Transform problem with fixed aspect ratio

2010-03-04 Thread Jae-Joon Lee
With axes aspect_ratio set, the position of the axes is determined during the drawing time. And the position of the inset axes also need to be adjusted during the drawing time to incorporate this, One way to archive this is to set axes_locator attribute, which accept a callable object that returns

Re: [Matplotlib-users] Plotting boolean/logical data type

2010-03-04 Thread Jae-Joon Lee
Not sure what exactly you want. Is this close? ax = subplot(111) tr = ax.get_xaxis_transform() ax.plot([0.2, 0.8], [0.5, 0.5], transform=tr) The x-coodinate is in data coordinate, but y coordinate is in (normalized) axes coordinate. More about the transforms behind matplotlib can be foun

Re: [Matplotlib-users] Using callbacks to change Axes positions

2010-03-04 Thread Jae-Joon Lee
see http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg15919.html axes_grid toolkit provides some helper function that utilizes axes_locator (take a look at demo_locatable_axes_easy function in the example below) http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_

Re: [Matplotlib-users] Using callbacks to change Axes positions

2010-03-05 Thread Jae-Joon Lee
ze="5%", pad=0.05, pack_start=True) > fig.add_axes(cax) > image = ax.imshow(np.random.random((100,100))) > cb = fig.colorbar(image, cax=cax) > > Cheers, > > Thomas > > On Mar 4, 2010, at 10:28 PM, Jae-Joon Lee wrote: > >> see >> >> http://www.mail

Re: [Matplotlib-users] Using callbacks to change Axes positions

2010-03-05 Thread Jae-Joon Lee
plot, and the > usual method for changing the label position, e.g.: > > for tick in cax.xaxis.get_major_ticks(): >  tick.tick1On = True >  tick.tick2On = True >  tick.label1On = False >  tick.label2On = True > > does not work. Do you have any idea why this might be? > >

Re: [Matplotlib-users] Using callbacks to change Axes positions

2010-03-05 Thread Jae-Joon Lee
divider.new_horizontal(size="5%", pad=0.05) > > Is it possible to then modify the size and pad parameters, or do I need to > delete the axes and start again? > > Cheers, > > Tom > > On Mar 5, 2010, at 12:20 PM, Jae-Joon Lee wrote: > >> Unfortunately, a

Re: [Matplotlib-users] Change colorbar orientation once drawn

2010-03-06 Thread Jae-Joon Lee
Try cb.orientation = "horizontal" cb.update_bruteforce(cb.mappable) it seems to work okay. However, note that "update_bruteforce" clears the axes then redraws. So, if you added some artists in the colorbar axes by yourself (although this is not likely), they will be lost. Regards, -JJ

Re: [Matplotlib-users] Re move, mask, or hide parts of a polygon?

2010-03-11 Thread Jae-Joon Lee
On Tue, Mar 9, 2010 at 4:22 PM, othererik wrote: > I assumed that my_polygon.set_clip_path( patch ) where patch is a > patches.Polygon would do the trick. > Please post a complete example that demonstrate your problem. My guess is that maybe you are not setting the transform of the clipping path

Re: [Matplotlib-users] Can't show grid on subplotzero???

2010-03-11 Thread Jae-Joon Lee
This is a known bug that is fixed in svn (maybe in maint. release too). The following link gives you a workaround. http://abitofpythonabitofastronomy.blogspot.com/2009/09/grid-bug-in-axesgrid.html Depending on your needs, it may better to use spines instead of axes_grid toolkit. http://matplotli

Re: [Matplotlib-users] turn off tick reflection

2010-03-11 Thread Jae-Joon Lee
On Wed, Mar 10, 2010 at 3:11 PM, Matthew MacLeod wrote: > I'm trying to make a plot that shares the x axis, but that have two > different y scales. I can do this, almost, I say almost because I don't > know how to turn off the reflection of my y ticks, so they are reflected > and obscure the scale

Re: [Matplotlib-users] legend: dash pattern length

2010-03-11 Thread Jae-Joon Lee
Did you try *handlelength*? http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.legend Regards, -JJ On Wed, Mar 10, 2010 at 4:50 PM, Alan G Isaac wrote: > I need a longer sample of the dash pattern in the legend. > Possible? (numpoints does not work.) > > Thanks, > Alan Is

Re: [Matplotlib-users] get current line cycle (color cycle), how to

2010-03-11 Thread Jae-Joon Lee
Try ax1 = subplot(121) ax2 = subplot(122) ax2._get_lines.color_cycle = ax1._get_lines.color_cycle ax1.plot([0,1]) ax2.plot([0,1]) Regards, -JJ On Thu, Mar 11, 2010 at 9:02 AM, Pribadi, Krishna wrote: > Hello all, > > Does anyone know how to get the current line cycle or color cycle for a >

Re: [Matplotlib-users] legend: dash pattern length

2010-03-11 Thread Jae-Joon Lee
On Thu, Mar 11, 2010 at 8:32 PM, Alan G Isaac wrote: > 1. What are the units (and why not points)? Fraction of (legend) font size (in points). It was decided that it is these dimensions are better to be scale with font size. For example, handlelength=5 means 50 points when legend font size is 10

Re: [Matplotlib-users] legend: dash pattern length

2010-03-12 Thread Jae-Joon Lee
On Fri, Mar 12, 2010 at 3:47 PM, Alan G Isaac wrote: > I suggest instead > "These values are measure in font-size units. > E.g., a fontsize of 10 points and a handlelength=5 > implies a handlelength of 50 points." > Thanks. Applied in r8159. Regards, -JJ

Re: [Matplotlib-users] vlines with no padding

2010-03-13 Thread Jae-Joon Lee
On Fri, Mar 12, 2010 at 11:11 AM, jdidion wrote: > but I > can't figure out how to make this happen, other than to use a really fat > line width (which I would prefer not to do) What other way do you have in mind? I don't see any. By the way, why not just use histogram? Regards, -JJ --

Re: [Matplotlib-users] Re move, mask, or hide parts of a polygon?

2010-03-13 Thread Jae-Joon Lee
On Fri, Mar 12, 2010 at 7:45 AM, othererik wrote: > Here's a short example that does the opposite of what I'm looking for.   The > goal is to take a the polygon "poly_patch" and "cut" regions out of it. > All I've managed to achieve so far has been to show regions of the > "poly_patch". > With cl

Re: [Matplotlib-users] Alpha compositing of ~60000 line plots takes forever

2010-03-16 Thread Jae-Joon Lee
If you're plotting lots of lines, do not use plot but use LineCollection instead. http://matplotlib.sourceforge.net/examples/api/collections_demo.html http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collections.LineCollection Here is slightly modified version of your code t

Re: [Matplotlib-users] [newbie] 2 problems: a) CJK, b) adding letters to points

2010-03-16 Thread Jae-Joon Lee
On Tue, Mar 16, 2010 at 3:30 AM, David wrote: > On 16/03/10 07:59, Gökhan Sever wrote: >> >> Probably you need a unicode font-set that contain all the characters for >> those alphabets. You can look at this example to see a simple unicode >> demonstration example. > > Yes, I have done that, for ex

Re: [Matplotlib-users] [newbie] 2 problems: a) CJK, b) adding letters to points

2010-03-16 Thread Jae-Joon Lee
On Tue, Mar 16, 2010 at 3:30 AM, David wrote: > This did not yield any results. With the above code, xlab.set_position((0.2, > 0.1)), I change the position of the xlabel. > But the problem is that my graph is cut before the xlabel has a chance to > appear (see dea.png). Basically the graph ends ri

Re: [Matplotlib-users] How do you add contrasting text to color image

2010-03-16 Thread Jae-Joon Lee
On Tue, Mar 16, 2010 at 12:10 PM, PaterMaximus wrote: > Another way would be to use a font with a dark edge and light interior (or > vice > versa) but I know of know such font for matplotlib. > FYI, the svn version of matplotlib supports this. http://matplotlib.sourceforge.net/trunk-docs/exampl

Re: [Matplotlib-users] Sharing axes on multiple subplots

2010-03-23 Thread Jae-Joon Lee
In the current implementation, sharing the axis does not mean sharing its scale. This is not a subplots-specific issue, but applies to all kind of axes sharing. So you need to change the scale of all the axes even though they have shared axis. What seems to be a better approach to me is to initial

Re: [Matplotlib-users] 3d pie charts

2010-03-23 Thread Jae-Joon Lee
You need to define your own path (or you may combine a wedge and rectangles). This may be helpful. http://matplotlib.sourceforge.net/users/path_tutorial.html Regards, -JJ On Sat, Mar 20, 2010 at 2:33 PM, Gary Jaffe wrote: > Hi all -- > > I'm new to Matplotlib, and it looks like a great proje

Re: [Matplotlib-users] the problem in pylab_examples example code: image_demo2.py

2010-03-23 Thread Jae-Joon Lee
The example assumes that the file is a dump of uin16 512x512 array. So, no doubt that it won't work with a png file. See http://matplotlib.sourceforge.net/users/image_tutorial.html -JJ On Tue, Mar 23, 2010 at 9:41 AM, yogesh karpate wrote: > The 1st code snippet of image_demo2.py is as follow

Re: [Matplotlib-users] Overlapping labels in pie charts

2010-03-23 Thread Jae-Joon Lee
This should be doable using the annotation. Here is a simple cook-up I just did. it uses a naive algorithm to place the labels, but I guess it gives you an idea how things work. a screenshot is attached. Regards, -JJ from pylab import * # make a square figure and axes figure(1, figsize=(6,6))

Re: [Matplotlib-users] Overlapping labels in pie charts

2010-03-24 Thread Jae-Joon Lee
    print >>sys.stderr, "Overlapping, offsetting a little > bit" >    y1 = y1 + 0.1 >        foo = theta > >    annotate(l1, >     (xc, yc), xycoords="data", >     xytext=(x1, y1), textcoords="d

Re: [Matplotlib-users] How to draw following gridlines

2010-03-24 Thread Jae-Joon Lee
Try something like minorticks_on() grid(True, color="k", ls="solid") grid(True, which="minor", color="r") -JJ On Wed, Mar 24, 2010 at 7:33 AM, yogesh karpate wrote: > Kindly find the image attached with this mail. I want to make the graph > with  grid lines(shown in background) as plotted  in a

Re: [Matplotlib-users] Bar plot, 0 values

2010-03-25 Thread Jae-Joon Lee
With the current svn, I cannot reproduce the problem, i.e., bars with 0 height are correctly displayed. The x-range is incorrectly set, but it is not clear if this is what you meant. Can you post a screenshot of your figure? Also, version of your matplotlib will be helpful. Regards, -JJ On We

Re: [Matplotlib-users] Bar plot, 0 values

2010-03-25 Thread Jae-Joon Lee
27;s a version that goes to the list too :-) > > On Fri, Mar 26, 2010 at 9:10 AM, Jae-Joon Lee wrote: >> With the current svn, I cannot reproduce the problem, i.e., bars with >> 0 height are correctly displayed. The x-range is incorrectly set, but >> it is not clear if this

Re: [Matplotlib-users] Copying collections over to a new figure

2010-03-29 Thread Jae-Joon Lee
As far as I can say, moving around artists from one axes to the other is NOT recommended. And I encourage you to create separate artists for each axes rather than try to reuse the existing ones. For your particular example, fig = mpl.figure() ax2 = fig.add_subplot(1,1,1) for c in ax1.collections:

Re: [Matplotlib-users] Copying collections over to a new figure

2010-03-30 Thread Jae-Joon Lee
ance, would it not be possible to have a > method that allows one to retrieve an Axes-independent LineCollection from an > Axes instance? (for example a get_collection method) This would then allow > one to 'recycle' existing collections. > > Cheers, > > Thomas >

Re: [Matplotlib-users] Copying collections over to a new figure

2010-03-30 Thread Jae-Joon Lee
On Tue, Mar 30, 2010 at 2:56 PM, Eric Firing wrote: > Is even that worth the potential extra complexity, both in the code and in > the documentation?  What is the real benefit? > I think there are some benefit of moving artists to another axes. Also this will help enabling moving an axes to anoth

Re: [Matplotlib-users] Histogramme bug report

2010-03-30 Thread Jae-Joon Lee
On Tue, Mar 30, 2010 at 11:12 AM, Julien wrote: > This script should give you a srange historamme, with bins that are half > the size they shoud be. > I'm sorry but it is not clear what is wrong. The histogram looks just fine to me. Maybe you wanted to do plt.hist(sorted(liste_histo),bins=rang

Re: [Matplotlib-users] manual placement of a colorbar

2010-04-01 Thread Jae-Joon Lee
If you're not afraid of contaminating your code with axes_grid toolkit, instead cax = fig.add_axes([0.9, 0.1, 0.1, 0.8]) # setup colorbar axes. try from mpl_toolkits.axes_grid import make_axes_locatable import matplotlib.axes as maxes divider = make_axes_locatable(ax) cax = divider.new_horizo

Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-02 Thread Jae-Joon Lee
I just had a quick look, but while extra "restore" could be a problem, the erroneous one may not be the one at line 1073, but the one at line 1066. I believe that the "restore" at 1073 is written by "pstoeps" function in backend_ps.py, and this function did write a matching "save" at line 11. Reg

Re: [Matplotlib-users] Tick line linewidth and linestyle don't work

2010-04-05 Thread Jae-Joon Lee
On Sun, Apr 4, 2010 at 11:55 AM, Thomas Robitaille wrote: > It looks as though the set_linewidth and set_linestyle commands are silently > ignored. Is this normal? I have submitted a bug report here: linewidth and linestyle are (or looks) ignored because ticklines are actually "markers". To chan

Re: [Matplotlib-users] Issues with Affine2D transform

2010-04-05 Thread Jae-Joon Lee
On Mon, Apr 5, 2010 at 10:05 AM, Michael Droettboom wrote: >> matplotlib.use('Agg') >> import matplotlib.pyplot as mpl >> from matplotlib.transforms import Affine2D >> import numpy as np >> >> image = np.random.random((100,100)) >> >> fig = mpl.figure() >> ax = fig.add_subplot(1,1,1) >> ax.pcolor(

Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-05 Thread Jae-Joon Lee
On Fri, Apr 2, 2010 at 11:20 AM, Michael Droettboom wrote: > It seems the relevant change is in r8102: "fix some issues in the bbox > after the postscript distiller is run".  This change removed a commented > out call to ps2eps.  I'm a bit out of my depth here as to why that > change was made, and

Re: [Matplotlib-users] legend markerscale does not work

2010-04-05 Thread Jae-Joon Lee
On Sun, Apr 4, 2010 at 2:56 AM, Levi Kilcher wrote: > And what the heck are the line objects in the legend?  Are there > separate marker objects that I am missing? > Yes. l = legend() l.get_lines()[0]._legmarker.set_ms(5) The line objects in the legend handles have a _legmarker attribute which

Re: [Matplotlib-users] axes_grid: labels on colorbar

2010-04-06 Thread Jae-Joon Lee
This is something that needs to be fixed in the next release. Meanwhile, try something like, cax = grid.cbar_axes[0] cax.axis["right"].toggle(ticks=True, ticklabels=True, label=True) cax.set_ylabel("Test") Regards, -JJ On Tue, Apr 6, 2010 at 3:26 PM, Angus McMorland wrote: > Hi all, > I'm try

Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-07 Thread Jae-Joon Lee
I tried to take a look but, pstopdf in my linux box works okay (it converted test_tex_r8216.eps fine also) and I'm afraid that I may not be able to track this down. Just in case, can you check if using a different distiller makes any difference? I believe you're using a ghostscript (or none where

Re: [Matplotlib-users] text annotations encircled?

2010-04-10 Thread Jae-Joon Lee
See these examples. bbox works in a same way for the text and the annotation. http://matplotlib.sourceforge.net/examples/pylab_examples/fancytextbox_demo.html http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo2.html And, the annotation guide my help. http://matplotlib.sou

Re: [Matplotlib-users] schematic diagrams - fancy boxes, packers and arrows

2010-04-13 Thread Jae-Joon Lee
> > Is it fairly easy to put something like this together using all the > offsetbox tools and fancy arrows? I tried to cook up something similar to what you described. See the attached file. Well, I would not say it is fairly easy, but not that difficult either I hope. The demo requires svn r8227

<    1   2   3   4   5   6   7   8   9   >