[Matplotlib-users] 'save file' GUI dialog

2014-06-20 Thread Thomas Robitaille
Hi everyone, I'm developing a simple GUI tool in Matplotlib that relies on the event framework to handle buttons/sliders. I am trying to avoid using a GUI toolkit directly to ensure maximum compatibility for users. One thing I would like is to be able to have a 'save' button that will open up a s

[Matplotlib-users] Transforming a rectangle or polygon

2014-08-21 Thread Thomas Robitaille
Hello, I am interested in using the Matplotlib transformation framework to transform a rectangle into a different coordinate system. I am therefore defining a Rectangle patch and setting the transform to what I want. If I apply a non-linear transformation, the edges of the rectangle should no long

[Matplotlib-users] Scientific Python Survey

2015-03-02 Thread Thomas Robitaille
Hi everyone, If you use scientific Python packages for your research/work, I would appreciate if you could take a few minutes to fill out the following survey: http://goo.gl/PXzFAk The aim of this survey is to find out what versions of Python and various scientific Python packages people are u

[Matplotlib-users] ANN: pytest-mpl v0.2

2015-06-25 Thread Thomas Robitaille
Hi everyone, I have just released a small plugin for py.test that wraps the image comparison functionality in matplotlib.testing, for use in other packages that use py.test as the testing framework instead of nose: https://github.com/astrofrog/pytest-mpl The idea is to make it easy to write a

Re: [Matplotlib-users] Call for new style defaults

2015-07-22 Thread Thomas Robitaille
Hi Thomas, Are there also already plans to change the default color cycle? Changing to one of the qualitative color sequences from colorbrewer2 would be a very nice change in defaults, but I am presuming that this has already been suggested? Cheers, Tom On 12 July 2015 at 18:11, Thomas Caswell

[Matplotlib-users] Creating axes with fixed distance from figure edge

2015-09-09 Thread Thomas Robitaille
Hi everyone, I am interested in creating axes in an interactive figure where the distance from the spines of the axes to the figure edge are constant in absolute terms. To clarify what I mean, when using add_axes([0.1, 0.1, 0.8, 0.8]), the spines of the axes are always located a distance from the

Re: [Matplotlib-users] Creating axes with fixed distance from figure edge

2015-09-09 Thread Thomas Robitaille
ld be easy to build as an Axes subclass? Cheers, Tom On 9 September 2015 at 23:12, Eric Firing wrote: > On 2015/09/09 11:01 AM, Thomas Robitaille wrote: >> >> Hi everyone, >> >> I am interested in creating axes in an interactive figure where the >> distance fro

Re: [Matplotlib-users] Creating axes with fixed distance from figure edge

2015-09-09 Thread Thomas Robitaille
something like: fig.add_axes([0.1, 0.1, 0.8, 0.8], preserve_absolute_margins=True) If this would be useful, I can open a pull request. Cheers, Tom On 9 September 2015 at 23:29, Thomas Robitaille wrote: > Thanks Eric - unfortunately I need to be able to resize the figure > interactively an

[Matplotlib-users] possible bug with scatter

2009-06-21 Thread Thomas Robitaille
Hi, I'm trying to use the scatter method, making use of the option to specify the marker as a tuple. From the documentation, it would seem that specifying marker=(0,3,0) should draw a circle. However, this is not the case. If you consider the following code: import matplotlib matplotlib.use('Agg

Re: [Matplotlib-users] possible bug with scatter

2009-06-21 Thread Thomas Robitaille
around. > > Regards, > > -JJ > > > On Sun, Jun 21, 2009 at 1:09 PM, Thomas > Robitaille wrote: >> >> Hi, >> >> I'm trying to use the scatter method, making use of the option to >> specify >> the marker as a tuple. From the documentation

Re: [Matplotlib-users] executing function when view interval changes

2009-08-01 Thread Thomas Robitaille
John Hunter-4 wrote: > > On Thu, Feb 12, 2009 at 2:13 PM, Ryan May wrote: >> On Wed, Feb 11, 2009 at 7:30 PM, John Hunter wrote: >>> >>> On Wed, Feb 11, 2009 at 2:49 PM, Ryan May wrote: > >> Well, I checked in an example that shows the functionality. The problem >> is >> that using these ev

[Matplotlib-users] Histogram with logarithmic x-axis

2009-08-03 Thread Thomas Robitaille
Hi, What is the easiest way to plot a histogram with a logarithmic x-axis? The Axes.hist() method takes a log=True/False argument, but this applies only to the y axis. Is the only solution to plot a histogram of np.log10(array) and to change the tick formatter to a Log formatter, or is there a m

[Matplotlib-users] bug in scatter?

2009-08-04 Thread Thomas Robitaille
Hi, The following script produces a single point that is green and translucent: import matplotlib.pyplot as mpl fig = mpl.figure() ax = fig.add_subplot(111) ax.scatter([0.],[0.],c=1.,alpha=0.2,vmin=0,vmax=2.0,cmap=mpl.cm.jet) fig.canvas.draw() and the following script produces a single point t

Re: [Matplotlib-users] bug in scatter?

2009-08-04 Thread Thomas Robitaille
Just a quick note - the last script in my previous email is wrong. I don't get the problem in that case, I get it if the arrays are 32-bit: import matplotlib.pyplot as mpl import numpy as np np.random.seed(-12421412) x = np.random.random(1).astype(np.float32) y = np.random.random(1).as

Re: [Matplotlib-users] Histogram with logarithmic x-axis

2009-08-05 Thread Thomas Robitaille
Matthias Michler wrote: > > > # > import numpy as np > import matplotlib.pyplot as plt > > # generate some data on log-scale > x = 10**np.random.uniform(size=1000) > # histogram with log-bining > plt.hist(x, bins=10**np.linspace(0, 1, 10)) > plt.xscale('log') > plt.show

[Matplotlib-users] simple colorbar question

2009-08-05 Thread Thomas Robitaille
Hi, Is there an easy way to force a colorbar to not take up space from the Axes it is being plotted next to? In the following example, what I would like is for the top Axes to remain the same size as the bottom one, and for the colorbar to place itself on the right of the top one. Is this easy to

[Matplotlib-users] Cursor position

2009-08-24 Thread Thomas Robitaille
Hi, I'm interested in controlling how the cursor position appears at the bottom of interactive windows. I noticed that by default, it is the Formatter that gets called. However, in my case, the displayed coordinates each depend on both the x and y pixel value, and therefore I need to somehow ove

Re: [Matplotlib-users] Cursor position

2009-08-24 Thread Thomas Robitaille
> I think the easiest solution is to override the Axes.format_coord. > For example, > > ax = gca() > ax.format_coord = lambda x,y : "x=%g y=%g" % (x, y) > > x,y are in data coordinate. I'm not sure if there is any side effect, > but it seems that the format_coord method is only used to display

[Matplotlib-users] make.osx file

2009-09-16 Thread Thomas Robitaille
Hello, The make.osx file is now required (or at least recommended) to build matplotlib on MacOS X, but the file is absent from the 0.9.1 RC1 tarfile. Is this an oversight, or is it deliberate? Thanks, Thomas -- Com

[Matplotlib-users] Problem when specifying formatter

2009-10-20 Thread Thomas Robitaille
Hi, I'm not sure what I'm doing wrong here: import matplotlib.pyplot as mpl from matplotlib.ticker import NullFormatter fig = mpl.figure() ax = fig.add_subplot(111) ax.xaxis.set_major_formatter(NullFormatter) This returns the error: Traceback (most recent call last): File "test.py", line 6,

[Matplotlib-users] Colorbar with labels on top

2009-10-21 Thread Thomas Robitaille
Hi, I'm trying to plot a horizontal colorbar with labels on top. I can use axcbar = fig.add_axes([0.2, 0.85, 0.6, 0.03]) axcbar.xaxis.set_ticks_position('top') cbar = fig.colorbar(s, cax=axcbar, orientation='horizontal') but then I lose the ticks on the bottom of the colorbar. However, setting

[Matplotlib-users] add_axes in inches

2009-11-05 Thread Thomas Robitaille
Hi, Is there an easy way to add axes to a figure, but specify the 'rect' in real rather than relative units? For example, something like: fig.add_axes([0.5,0.5,3.,3.], inches=True) This would guarantee that for example if I want to increase the canvas size to add more subplots, I don't have

[Matplotlib-users] FancyArrows don't connect

2009-11-18 Thread Thomas Robitaille
Hello, I'm trying to plot two perpendicular arrows and getting them to start from the exact same point. If I try the following: --- import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as mpl from matplotlib.patches import FancyArrowPatch fig = mpl.figure() ax = fig.add_subplot(

Re: [Matplotlib-users] FancyArrows don't connect

2009-11-18 Thread Thomas Robitaille
rrows are drawn. > > http://matplotlib.sourceforge.net/users/annotations_guide.html#annotating-with-arrow > > -JJ > > > On Thu, Nov 19, 2009 at 9:46 AM, Thomas Robitaille > wrote: >> Hello, >> >> I'm trying to plot two perpendicular arrows and getting

[Matplotlib-users] Automatic resizing of colorbar

2009-12-14 Thread Thomas Robitaille
Hi, I would like to plot a colorbar which automatically gets resized when I change the view limits and the aspect ratio of the main axes. So for example: import matplotlib.pyplot as mpl import numpy as np fig = mpl.figure() ax = fig.add_axes([0.1,0.1,0.7,0.8]) cax = fig.add_axes([0.81,0.1,0.

[Matplotlib-users] LogFormatter and 0.1, 1, and 10

2010-01-25 Thread Thomas Robitaille
Hello, I'm trying to make a log plot using set_xscale and set_yscale. The default LogFormatter however shows 10^-1, 10^0, and 10^1 rather than 0.1, 1, and 10 (other plotting packages I've used usually automatically substitute these three common labels). Is there a way that the LogFormatter coul

[Matplotlib-users] Change colorbar orientation once drawn

2010-03-04 Thread Thomas Robitaille
Hi, I would like to change the orientation of a colorbar once it has already been drawn. So for example if I create the colorbar with: cb = fig.colorbar(mappable=image, cax=cax, orientation='vertical') I would like to be able to do cb.set_orientation('horizontal') Is there a way to do this, s

[Matplotlib-users] Using callbacks to change Axes positions

2010-03-04 Thread Thomas Robitaille
Hi, I am trying to set up a colorbar that automatically resizes if I zoom in to an image (which changes the aspect ratio of the axes, so I want the colorbar to get resized too). Let's say I have two Axes instances, say ax (for the main image) and cax (for the colorbar). I can set up a callback

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

2010-03-05 Thread Thomas Robitaille
er 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_divider.html > > -JJ > > > > > On Thu, Mar 4, 2010 at 9:05 PM, Thomas Robitaille >

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

2010-03-05 Thread Thomas Robitaille
axes_locator (take a look at demo_locatable_axes_easy function in the > example below) > > http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_divider.html > > -JJ > > > > > On Thu, Mar 4, 2010 at 9:05 PM, Thomas Robitaille > wrote: >> Hi, >> >> I a

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

2010-03-05 Thread Thomas Robitaille
ing > over major_ticks, you do > > cax.axis["left"].toggle(all=False) > cax.axis["right"].toggle(all=True) > > Regards, > > -JJ > > > On Fri, Mar 5, 2010 at 9:38 AM, Thomas Robitaille > wrote: >> Hi Jae-Joon, >> &g

[Matplotlib-users] MacOS 10.6 install dependency building fails (r8214)

2010-03-29 Thread Thomas Robitaille
Hello, It looks like the zlib website removes previous version of its library that were previously available for download, so the part in make.osx where http://www.zlib.net/zlib-1.2.3.tar.gz is fetched now fails (since the current version is 1.2.4). The error in the matplotlib building is not e

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

2010-03-29 Thread Thomas Robitaille
Hello, In the following example, I am trying to copy over existing collections from one plot to another: import matplotlib.pyplot as mpl fig = mpl.figure() ax1 = fig.add_subplot(1,1,1) ax1.scatter([0.5],[0.5]) fig.savefig('test1.png') fig = mpl.figure() ax2 = fig.add_subplot(1,1,1) for c in ax

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

2010-03-29 Thread Thomas Robitaille
a >ax2.add_collection(c) > > should work. > > Regards, > > -JJ > > > > > On Mon, Mar 29, 2010 at 12:24 PM, Thomas Robitaille > wrote: >> Hello, >> >> In the following example, I am trying to copy over existing collections from

[Matplotlib-users] EPS files with LaTeX are invalid

2010-04-01 Thread Thomas Robitaille
Hello, I upgraded to the latest svn version of matplotlib today, and found that eps files produced with the system latex now seem to be invalid. For example, if I run the following script import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as mpl mpl.rc('text', usetex=False) fig

Re: [Matplotlib-users] MacOS 10.6 install dependency building fails (r8214)

2010-04-02 Thread Thomas Robitaille
Thomas Robitaille wrote: > > It looks like the zlib website removes previous version of its library > that were previously available for download, so the part in make.osx where > http://www.zlib.net/zlib-1.2.3.tar.gz is fetched now fails (since the > current version is 1.2.4). T

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

2010-04-02 Thread Thomas Robitaille
? What version of LaTeX is this? > > Mike > > Thomas Robitaille wrote: >> Hello, >> >> I upgraded to the latest svn version of matplotlib today, and found that eps >> files produced with the system latex now seem to be invalid. For example, if

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

2010-04-02 Thread Thomas Robitaille
"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 why .eps files seemingly haven't been true .eps files for a long time

[Matplotlib-users] Issues with Affine2D transform

2010-04-02 Thread Thomas Robitaille
Hi, I have been trying to use the Affine2D transformation with pcolor and contour, with no success. The following script and comments illustrates my problems: matplotlib.use('Agg') import matplotlib.pyplot as mpl from matplotlib.transforms import Affine2D import numpy as np image = np.random.ra

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

2010-04-04 Thread Thomas Robitaille
Hi, In the following script: --- import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as mpl fig = mpl.figure() ax = fig.add_subplot(1,1,1) for line in ax.xaxis.get_ticklines(): line.set_markersize(20) line.set_linewidth(10) line.set_linestyle('dashed') fig.savefig('t

[Matplotlib-users] Issue with PatchCollection

2010-04-14 Thread Thomas Robitaille
Hi, Last year, I submitted a bug report regarding the fact that PatchCollection's match_original argument does not work properly, in a pretty simple script: https://sourceforge.net/tracker/?func=detail&aid=2881485&group_id=80706&atid=560720 I came across the problem again several times recently

[Matplotlib-users] matplotlib sphinxext and savefig

2010-04-17 Thread Thomas Robitaille
Hello, I am currently using the sphinxext module to write documentation that includes automatically generated plots. I was wondering if there is a way to override the default savefig behavior for this - for example, I would like all the plots for the documentation to have the bbox_inches='tight

[Matplotlib-users] Issues with Circle

2010-04-23 Thread Thomas Robitaille
Hi, I'm having issues with translucent patches. The following code import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as mpl from matplotlib.patches import Circle fig = mpl.figure() ax = fig.add_subplot(111) c = Circle((0.25,0.5), radius=0.2, facecolor='none', edgecolor='green', a

[Matplotlib-users] Modifying contours

2009-01-29 Thread Thomas Robitaille
Hi all, I am trying to do the following to produce a customized contour plot: 1. Create a ContourSet from contour() 2. Retrieve vertex positions from this ContourSet 3. Modify the vertex positions by applying a coordinate transformation 4. Apply the changes to the ContourSet 5. Plot the ContourSe

[Matplotlib-users] ticks Locator class

2009-02-03 Thread Thomas Robitaille
Hi everyone, I am defining my own Locator class to determine where matplotlib should place the ticks on the x axis. I have managed do so, except for one problem. In order to determine the position of the ticks on the x-axis, I not only need the x axis range, which I can retrieve with self.

[Matplotlib-users] different Locator for opposite axes

2009-02-08 Thread Thomas Robitaille
Hi everyone, I am plotting a figure where I need two independent x axes and two independent y axes. I've tried to use both twinx and twiny at the same time, and this works to some extent, but it looks like it is plotting the labels for the bottom x axis and the right-hand y axis twice, whi

[Matplotlib-users] executing function when view interval changes

2009-02-11 Thread Thomas Robitaille
Hi everyone, I wish to execute a certain function every time the view interval of a figure is updated, for example when it is changed interactively using the zoom rectangle or home button in WXAgg. Matplotlib must already be calling certain routines, such as the tick locator and formatters

[Matplotlib-users] Getting contour positions without interacting with figure/axes

2009-02-21 Thread Thomas Robitaille
Hello, I am using matplotlib to show an image using: fig = figure() ax = fig.add_subplot(111) ax.imshow(image) After doing this, I want to find the contours for a different image (with different dimensions), but I do not want to interact with the current figure or axes, I just want to retriev

Re: [Matplotlib-users] Getting contour positions without interacting with figure/axes

2009-02-22 Thread Thomas Robitaille
: > Thomas Robitaille wrote: >> Hello, >> >> I am using matplotlib to show an image using: >> >> fig = figure() >> ax = fig.add_subplot(111) >> ax.imshow(image) >> >> After doing this, I want to find the contours for a different image >

Re: [Matplotlib-users] Getting contour positions without interacting with figure/axes

2009-02-22 Thread Thomas Robitaille
Hi Eric, I'm using matplotlib 0.98 (which comes with the Enthought distribution) so that would explain why there was an issue. Thanks for your help! Thomas Eric Firing wrote: > Thomas Robitaille wrote: >> Hi Eric, >> >> Thanks for your help! Unfortunately, ax.se

[Matplotlib-users] Rotating in imshow

2009-03-13 Thread Thomas Robitaille
Hello, I was wondering whether there is a way to rotate a grayscale/ colorscale when using imshow. I have been using PGPLOT (a fortran/c plotting library) for many years now, and the equivalent to imshow is called PGGRAY (or PGIMAG). One of the arguments this function takes is a 6-element ar

Re: [Matplotlib-users] Rotating in imshow

2009-03-13 Thread Thomas Robitaille
D im = np.random.random((10,10)) tr = Affine2D().rotate_deg(45.) fig = figure() ax = fig.add_subplot(111) ax.imshow(im,transform=tr) fig.canvas.draw() Am I doing something wrong? Thanks! Thomas On Mar 13, 2009, at 5:20 PM, Andrew Straw wrote: > Eric Firing wrote: >> Thomas Robitaille wrote: >&g

Re: [Matplotlib-users] Rotating in imshow

2009-03-13 Thread Thomas Robitaille
wrote: > Eric Firing wrote: >> Thomas Robitaille wrote: >>> Hello, >>> >>> I was wondering whether there is a way to rotate a grayscale/ >>> colorscale when using imshow. >>> >>> I have been using PGPLOT (a fortran/c plotting library) for man

Re: [Matplotlib-users] Rotating in imshow

2009-03-13 Thread Thomas Robitaille
ax.imshow(im,transform=tr) >> fig.canvas.draw() >> Am I doing something wrong? >> Thanks! >> Thomas >> On Mar 13, 2009, at 5:20 PM, Andrew Straw wrote: >>> Eric Firing wrote: >>>> Thomas Robitaille wrote: >>>>> Hello, >>&

[Matplotlib-users] imshow without resampling

2009-03-31 Thread Thomas Robitaille
Hello, I am using matplotlib to create postscript and SVG files. I am currently using imshow to show the contents of an array, but this means that when saving vector graphics files, matplotlib resamples the image/array onto a finer grid. What I would like, is for code such as this: import

Re: [Matplotlib-users] imshow without resampling

2009-03-31 Thread Thomas Robitaille
=(4,4)) ax = fig.add_subplot(111) ax.pcolor(image) fig.savefig('plot.ps') produces a 2Mb+ file. Thanks, Thomas On Mar 31, 2009, at 4:32 PM, John Hunter wrote: > On Tue, Mar 31, 2009 at 2:56 PM, Thomas Robitaille > wrote: >> Hello, >> >> I am using matplot

Re: [Matplotlib-users] imshow without resampling

2009-04-02 Thread Thomas Robitaille
he output is not properly handled for PS files. Is this something that could be fixed in future? Thanks, Thomas On Mar 31, 2009, at 4:32 PM, John Hunter wrote: > On Tue, Mar 31, 2009 at 2:56 PM, Thomas Robitaille > wrote: >> Hello, >> >> I am using matplotlib to create

[Matplotlib-users] Updating vmin and vmax in imshow

2009-04-03 Thread Thomas Robitaille
Hello, I am plotting a numpy array with image = imshow(array,vmin=0,vmax=100) If I want to change the array, I can then do image.set_data(new_array) and I can also update the colormap, etc. But I can't find any options to update the vmin and vmax values. Am I missing something? What I am l

Re: [Matplotlib-users] Updating vmin and vmax in imshow

2009-04-03 Thread Thomas Robitaille
> image.set_clim(vmin=10) This works great - thanks! Thomas -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/list

[Matplotlib-users] PatchCollection and match_original=True

2009-04-04 Thread Thomas Robitaille
Hi, I've found that the match_original=True option in PatchCollection causes matplotlib to crash. I have submitted two bug reports: https://sourceforge.net/tracker/?func=detail&aid=2732455&group_id=80706&atid=560720 https://sourceforge.net/tracker/?func=detail&aid=2723527&group_id=80706&atid=56

[Matplotlib-users] EPS rasterizing - a solution (and a question)

2009-04-17 Thread Thomas Robitaille
Hi, A while ago, I sent an email around asking about the EPS output from matplotlib. The following example summarizes the problem well: import matplotlib matplotlib.use('Agg') from matplotlib.pyplot import * import numpy as np nx,ny = 10,10 image = np.random.random((nx,ny)) fig = figure(fig

[Matplotlib-users] savefig bug

2009-04-21 Thread Thomas Robitaille
Hi, I've come across a bug with the savefig method when using the dpi= argument and saving an EPS file. If you try the following code, you will see that the frame is incomplete. Is there a way to solve this from a user point of view? --- import matplotlib matplotlib.use('Agg') from matplot

Re: [Matplotlib-users] savefig bug

2009-04-21 Thread Thomas Robitaille
ter insight though. > > Regards, > > -JJ > > > > On Tue, Apr 21, 2009 at 9:59 AM, Thomas Robitaille > wrote: >> Hi, >> >> I've come across a bug with the savefig method when using the dpi= >> argument and saving an EPS file. If you try the followi

[Matplotlib-users] PNG output and clipping

2009-04-21 Thread Thomas Robitaille
Hello, I am having a problem with imshow and PNG output. The following code can reproduce the problem: --- import matplotlib matplotlib.use('Agg') from matplotlib.pyplot import * import numpy as np image = np.random.random((100,100)) fig = figure(figsize=(4,4)) ax = fig.add_subplot(111) ax.

Re: [Matplotlib-users] savefig bug

2009-04-23 Thread Thomas Robitaille
It works great now - thanks for fixing this! Thomas On Apr 23, 2009, at 10:29 AM, Michael Droettboom wrote: > I think Jae-Joon's assesment is correct, since the logical dpi in PS > is hardcoded to 72.0. I have made this change in the SVN repository. > > Mike > >

[Matplotlib-users] xlabel vertical positioning

2009-04-27 Thread Thomas Robitaille
Hi, This is probably a simple question, but what is the best way to control the vertical positioning of the x-axis label? I tried: import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as mpl fig = mpl.figure() ax = fig.add_subplot(111) ax.set_xlabel("Hello",position=(0.5,-0.2)) fig

Re: [Matplotlib-users] xlabel vertical positioning

2009-04-28 Thread Thomas Robitaille
Hi Jouni, Thanks for your help! Following what you suggested, I've decided to use ax.text(0.5,-0.13,xlabel,transform =ax.transAxes,ha='center',va='center') Thanks, Thomas On 28 Apr 2009, at 01:39, Jouni K. Seppänen wrote: > Thomas Robitaille writes: > >&g

[Matplotlib-users] overriding the save button

2009-04-28 Thread Thomas Robitaille
Hi, I was wondering if it is possible to override the 'save' button in wxAgg so that once a filename has been specified in the dialog, a custom function is run instead of the default savefig? Maybe this would require too much hacking? Thanks for any advice, Thomas

[Matplotlib-users] Font size and savefig

2009-04-28 Thread Thomas Robitaille
Hi, I am using the savefig method to save plots - however, I am finding that the font size is systematically larger in the saved images than in the WxAgg window. It seems that text is ~30% larger in PNG and PDF files compared to the WxAgg display (relative to the axes box size). This can b

Re: [Matplotlib-users] xlabel vertical positioning

2009-04-28 Thread Thomas Robitaille
adjust label position. > e.g. > > import pylab > hAxes = pylab.axes() > pylab.xlabel('test') > hAxes.xaxis.LABELPAD = 0 > pylab.show() > > -- > Yong-Duk Jin > > On Tuesday 28 April 2009 14:08:50 Thomas Robitaille wrote: >> Hi, >> >> T

Re: [Matplotlib-users] overriding the save button

2009-04-28 Thread Thomas Robitaille
toolbar.save to actually point to my custom savefig? Thanks! Thomas On 28 Apr 2009, at 11:57, John Hunter wrote: > > > On Tue, Apr 28, 2009 at 8:21 AM, Thomas Robitaille > > wrote: > Hi, > > I was wondering if it is possible to override the 'save' button in > wxA

[Matplotlib-users] Fixed patch relative to axes

2009-04-29 Thread Thomas Robitaille
Hi, Is there an easy way to draw a patch or a patchcollection such that it always stays at the same relative position in a set of axes, rather than at the same pixel position? So for example, I would want to plot it at (0.1,0.1) relative to the axes, and if I zoom in I would still want it

Re: [Matplotlib-users] Fixed patch relative to axes

2009-04-29 Thread Thomas Robitaille
, Thomas On 29 Apr 2009, at 21:13, Eric Firing wrote: > Thomas Robitaille wrote: >> Hi, >> Is there an easy way to draw a patch or a patchcollection such that >> it always stays at the same relative position in a set of axes, >> rather than at the same pixel positi

Re: [Matplotlib-users] Font size and savefig

2009-04-29 Thread Thomas Robitaille
Hi Jae-Jong and John, Thanks for your replies! While experimenting with this to send screenshots, I realized that my default backend was set to MacOSX, not WXAgg. The WXAgg output to the screen actually agrees with the PNG output in terms of font sizes. But the font sizes differ between the

[Matplotlib-users] Enforcing common view limits

2009-05-01 Thread Thomas Robitaille
Hello, I want to create two sets of axes for a figure that would be equivalent to ax = fig.add_subplot(111) ax2 = ax .figure .add_axes(ax.get_position(True),frameon=False,sharex=ax,sharey=ax) except that I want to be able to specify different tick locators and formatters for ax and ax2.

Re: [Matplotlib-users] Font size and savefig

2009-05-01 Thread Thomas Robitaille
der if others can test this. >> >> -JJ >> >> >> On Thu, Apr 30, 2009 at 9:32 AM, Michael Droettboom >> wrote: >> >>> I forwarded this message to Michiel de Hoon, the author of the Mac >>> OS-X >>> backend, in case he has any

Re: [Matplotlib-users] Fixed patch relative to axes

2009-05-01 Thread Thomas Robitaille
Thanks! Thomas On 1 May 2009, at 15:04, Eric Firing wrote: > Christopher Barker wrote: >> Eric Firing wrote: >>> Split the command up: >>> p = Circle(...) >>> ax.add_patch(p, ...) >>> >>> (add_* could be modified to return the reference; maybe this would >>> be >>> worthwhile.) >> >> +1 >> >>

Re: [Matplotlib-users] Enforcing common view limits

2009-05-02 Thread Thomas Robitaille
I've realized that using the ParasiteAxes from the mpl_toolkits should do exactly what I'm asking. However, I am having a problem with callbacks when the x and y limits change (try resizing the window). The following script shows that the callback for the second set of axes is not carried out. Is

Re: [Matplotlib-users] Enforcing common view limits

2009-05-02 Thread Thomas Robitaille
There was a typo in the script, the callbacks should be ax.name = "first axis" ax.callbacks.connect('xlim_changed',check_callback) ax.callbacks.connect('ylim_changed',check_callback) ax2 = ax.twin() ax2.name = "second axis" ax2.callbacks.connect('xlim_changed',check_callback) ax2.callbacks

Re: [Matplotlib-users] Fast imshow plotting

2009-05-02 Thread Thomas Robitaille
Not sure if this will help, but maybe you can do something like this? --- #!/usr/bin/env python from pylab import * from scipy import * img = standard_normal((40,40)) image = imshow(img,interpolation='nearest',animated=True,label="blah") for k in range(1,1): img = standard_normal((40,4

[Matplotlib-users] EllipseCollection

2009-05-06 Thread Thomas Robitaille
Hi, I noticed that it's not possible to specify the position of the ellipses in an EllipseCollection: http://matplotlib.sourceforge.net/api/collections_api.html?highlight=ellipsecollection#matplotlib.collections.EllipseCollection Of course, I can just create a collection of individual Ellipse

Re: [Matplotlib-users] EllipseCollection

2009-05-06 Thread Thomas Robitaille
Hi Mike, Thanks for pointing this out - I hadn't noticed the offsets argument. I'll try it out! Cheers, Tom On May 6, 2009, at 10:39 AM, Michael Droettboom wrote: > "offsets" is intended to work for this. Is it broken? > > Cheers, > Mike > > Thomas Ro

[Matplotlib-users] Alpha values not preserved with Ellipse and PatchCollection

2009-05-06 Thread Thomas Robitaille
Hello, The following code should produce identical plots, but in the second case the alpha value is ignored: --- import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as mpl from matplotlib.patches import Ellipse from matplotlib.collections import PatchCollection fig = mpl.figure()

[Matplotlib-users] strange issue

2009-05-07 Thread Thomas Robitaille
Hello, I'm having a strange issue, and I've managed to reduce it to a simple problem. I created the following file structure: - a directory named scripts/ - a script called scripts/inspect.py - a script called scripts/test.py inspect.py contains just 'pass' and test.py contains 'from matplot

[Matplotlib-users] svn revision number

2009-05-08 Thread Thomas Robitaille
Hello, I was wondering whether there is an easy way to find out the svn revision number of matplotlib in python. I tried: In [2]: matplotlib.__revision__ Out[2]: '$Revision: 6887 $' but this isn't actually the current revision number, I have upgraded to 7096 (I'm suspecting that 6887 is the

[Matplotlib-users] Issues with clang when building on MacOS 10.7

2012-02-23 Thread Thomas Robitaille
Hello, I am trying to build the latest version of matplotlib from the git repository (1cd07a6c) on MacOS 10.7, and regardless of whether I build using the make.osx file or just 'python setup.py build', the C files get compiled with clang, and clang raises an error on one of the files: /Develop

[Matplotlib-users] Making an interactive plot faster

2013-06-24 Thread Thomas Robitaille
Hi everyone, The following shows an example of a simple data viewer which includes a slider, a bitmap, and a scatter plot: """ import numpy as np from matplotlib import pyplot as plt from matplotlib.widgets import Slider fig = plt.figure() ax1 = fig.add_axes([0.1, 0.1, 0.4, 0.7]) image = ax1.im

Re: [Matplotlib-users] Making an interactive plot faster

2013-06-25 Thread Thomas Robitaille
June 2013 16:13, Michael Droettboom wrote: > Have you tried using "draw_idle"? That will schedule the draw for the > next time the event loop is idle. > > Mike > > On 06/24/2013 07:39 AM, Thomas Robitaille wrote: >> Hi everyone, >> >> The following

[Matplotlib-users] bbox_inches='tight' issue with text outside axes

2010-06-03 Thread Thomas Robitaille
Hello, I have run into a problem with the bbox_inches='tight' option which allows a tight bounding box to be computed for a plot. In the following example: import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as mpl fig = mpl.figure() ax = fig.add_subplot(1,1,1) ax.text(-0.2,0.5,'te

[Matplotlib-users] MacOS X backend broken

2010-06-08 Thread Thomas Robitaille
Hello, I updated to svn r8396 today, and the MacOSX backend is broken. The following code import matplotlib matplotlib.use('MacOSX') import matplotlib.pyplot as mpl fig = mpl.figure() ax = fig.add_subplot(1,1,1) fig.canvas.draw() produces the following error: File "/Users/tom/Library/Python

[Matplotlib-users] Arrow in log space

2010-07-28 Thread Thomas Robitaille
Hi, How does one plot an arrow in a log log plot? In the following example, I can't get the arrow head, regardless of what value I use for the head width: import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.arrow(0.2,0.2,0.5,

[Matplotlib-users] Problem with errorbar in log scale

2010-09-01 Thread Thomas Robitaille
Hi, When using log scale, if the error is larger than flux, the error bar does not plot at all: import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.errorbar([1.],[1.],yerr=[2.]) ax.set_yscale('log') fig.savefig('test.png')

[Matplotlib-users] MacOS X install and ppc flag

2010-09-04 Thread Thomas Robitaille
Hi, Is there a way to prevent the matplotlib install from trying to compile for ppc for the c++ compiler? I usually set export MACOSX_DEPLOYMENT_TARGET=10.6 export CFLAGS="-arch i386 -arch x86_64" export CPPFLAGS="-arch i386 -arch x86_64" export FFLAGS="-arch i386 -arch x86_64" export LDFLAGS="-

[Matplotlib-users] Cursor position

2010-10-07 Thread Thomas Robitaille
Hi, I am using matplotlib with the MacOSX backend. If I run: import matplotlib matplotlib.use('MacOSX') import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(1,1,1) the cursor coordinates are missing from the bottom right of the window. If I click on the figure, the coordinat

[Matplotlib-users] Issue with imshow and usetex

2011-02-28 Thread Thomas Robitaille
Hi, In the following example: --- import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.imshow(np.random.random((1024, 1024)), interpolation='nearest') fig.savefig('test_1.eps') mpl.rc('text', usetex=True

Re: [Matplotlib-users] Issue with imshow and usetex

2011-03-11 Thread Thomas Robitaille
e ~4M in size. > > Can you check if the file size varies significantly with rc parameters > ps.usedistiller? > I'm not sure how text setting can affect the images. > > Regards, > > -JJ > > > > On Tue, Mar 1, 2011 at 7:23 AM, Thomas Robitaille >

Re: [Matplotlib-users] Issue with imshow and usetex

2011-03-12 Thread Thomas Robitaille
rds, > > -JJ > > > > On Sat, Mar 12, 2011 at 2:46 AM, Thomas Robitaille > wrote: >> Hi Jae-Joon, >> >> I tried inserting: >> >> mpl.rc('ps', usedistiller=None) >> >> after importing matplotlib, and I get: >>

[Matplotlib-users] zorder for collections

2011-04-02 Thread Thomas Robitaille
Hi, I would like to set the zorder on a collection e.g. PatchCollection. By looking at the matplotlib source code in collections.py, I figured that it would be possible to set the zorder attribute of a collection manually, e.g. p = PatchCollection(...) p.zorder = ... but I was wondering whethe

[Matplotlib-users] dpi in savefig ignored if imshow uses interpolation='nearest'

2011-04-12 Thread Thomas Robitaille
Hi, If I use interpolation='nearest' in an imshow command, when I try and save the image using savefig, the dpi= argument seems to have no effect. I have created a bug report on GitHub: https://github.com/matplotlib/matplotlib/issues/83 Thanks for any help, Tom

Re: [Matplotlib-users] Issue with imshow and usetex

2011-04-15 Thread Thomas Robitaille
> and replace "pswrite" with "ps2write". > > Regards, > > -JJ > > > > > On Sun, Mar 13, 2011 at 1:45 AM, Thomas Robitaille > wrote: >> Hi Jae-Joon, >> >> Ok, that makes sense - I tried upgrading to 9.0.1 and it looks like there

  1   2   >