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 <thomas.robitai...@gmail.com> wrote: > Thanks Eric - unfortunately I need to be able

[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

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

2015-09-09 Thread Thomas Robitaille
be easy to build as an Axes subclass? Cheers, Tom On 9 September 2015 at 23:12, Eric Firing <efir...@hawaii.edu> wrote: > On 2015/09/09 11:01 AM, Thomas Robitaille wrote: >> >> Hi everyone, >> >> I am interested in creating axes in an interactive figure wher

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] 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

[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

[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

[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

[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:

[Matplotlib-users] Bug in imread

2011-04-29 Thread Thomas Robitaille
Hi, I've found a bug in imread which causes images in PNG and JPEG format to be flipped when using imshow. For example, import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(1,2,1) image = plt.imread('2mass_rgb.png') ax.imshow(image,

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

2011-04-15 Thread Thomas Robitaille
, Thomas Robitaille thomas.robitai...@gmail.com wrote: Hi Jae-Joon, Ok, that makes sense - I tried upgrading to 9.0.1 and it looks like there is still an issue: 6204    test_1.eps 34104   test_2.eps Cheers, Tom On Mar 12, 2011, at 11:38 AM, Jae-Joon Lee wrote: Note that, even

[Matplotlib-users] Large circle causes matplotlib to hang

2011-04-15 Thread Thomas Robitaille
Hi, The following code causes matplotlib to hang: --- import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from matplotlib.patches import Circle fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.add_patch(Circle((1.e17, 1.e17), radius=1.e15))

[Matplotlib-users] Bounding box no longer works for EPS files if usetex=True

2011-04-15 Thread Thomas Robitaille
Hello, It seems that at some point in the last few months a change was made that means that the following code no longer works properly: --- import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np mpl.rc('text', usetex=True) fig = plt.figure() ax =

Re: [Matplotlib-users] Bounding box no longer works for EPS files if usetex=True

2011-04-15 Thread Thomas Robitaille
/issues/85 Cheers, Tom On Friday, April 15, 2011 at 7:22 PM, Thomas Robitaille wrote: Hello, It seems that at some point in the last few months a change was made that means that the following code no longer works properly: --- import matplotlib as mpl mpl.use('Agg') import

[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

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

2011-03-12 Thread Thomas Robitaille
are ~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 thomas.robitai...@gmail.com wrote: Hi, In the following

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

2011-03-11 Thread Thomas Robitaille
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 thomas.robitai...@gmail.com wrote: Hi, In the following example: --- import numpy as np import matplotlib as mpl mpl.use('Agg

[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',

[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

[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=-Wall

[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 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

[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)

[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',

[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

[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=detailaid=2881485group_id=80706atid=560720 I came across the problem again several times recently,

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). The error

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

2010-04-02 Thread Thomas Robitaille
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 I run the following script import matplotlib matplotlib.use('Agg') import

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

2010-04-02 Thread Thomas Robitaille
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 prior to that change. Anyone else? Mike Thomas Robitaille wrote: It seems

[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 =

[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

[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

[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

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

2010-03-29 Thread Thomas Robitaille
. Regards, -JJ On Mon, Mar 29, 2010 at 12:24 PM, Thomas Robitaille thomas.robitai...@gmail.com wrote: 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

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

2010-03-05 Thread Thomas Robitaille
(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 thomas.robitai...@gmail.com wrote: Hi, I am trying to set up a colorbar

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

2010-03-05 Thread Thomas Robitaille
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 thomas.robitai...@gmail.com wrote: Hi, I am trying to set up a colorbar that automatically resizes if I zoom

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

2010-03-05 Thread Thomas Robitaille
(all=True) Regards, -JJ On Fri, Mar 5, 2010 at 9:38 AM, Thomas Robitaille thomas.robitai...@gmail.com wrote: Hi Jae-Joon, I am encountering another issue, when using the method you suggest in combination with the parasite_axes from the matplotlib toolkit: --- import

[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,

[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

[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

[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 =

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

2009-11-18 Thread Thomas Robitaille
://matplotlib.sourceforge.net/users/annotations_guide.html#annotating-with-arrow -JJ On Thu, Nov 19, 2009 at 9:46 AM, Thomas Robitaille thomas.robitai...@gmail.com wrote: Hello, I'm trying to plot two perpendicular arrows and getting them to start from the exact same point. If I try

[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] 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,

[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] 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 --

[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

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 the

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

[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

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 rma...@gmail.com wrote: On Wed, Feb 11, 2009 at 7:30 PM, John Hunter jdh2...@gmail.com wrote: On Wed, Feb 11, 2009 at 2:49 PM, Ryan May rma...@gmail.com wrote: Well, I checked in an example that shows the functionality. The

[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

Re: [Matplotlib-users] possible bug with scatter

2009-06-21 Thread Thomas Robitaille
Hi Jae-Joon, Thanks for the quick fix! Just looked in the svn browser, and noticed you changed line 5290 of axes.py to 'o' : (0,0,3), Should this not be 'o' : (0,3,0), ? Thanks, Tom On Jun 21, 2009, at 2:59 PM, Jae-Joon Lee wrote: Thanks for the report. And, this turned out to be a

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 Robitaille wrote: Hi, I noticed that it's

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)

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 =

[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
thoughts. Mike Thomas Robitaille wrote: 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

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 Done in r7077. Eric

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 position? So for example, I would want

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

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 thomas.robitai...@gmail.com writes

[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

Re: [Matplotlib-users] xlabel vertical positioning

2009-04-28 Thread Thomas Robitaille
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, This is probably a simple question, but what is the best way to control the vertical positioning

Re: [Matplotlib-users] overriding the save button

2009-04-28 Thread Thomas Robitaille
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 thomas.robitai...@gmail.com wrote: Hi, I was wondering if it is possible to override the 'save' button in wxAgg so that once a filename has

[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))

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 Thomas Robitaille wrote: Thanks

[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

Re: [Matplotlib-users] savefig bug

2009-04-21 Thread Thomas Robitaille
(which is the dpi of the figure when ps backend is used) seems to solve the problem. Thomas, I don't see any easy workaround for this bug other than patching the code. Others may have better insight though. Regards, -JJ On Tue, Apr 21, 2009 at 9:59 AM, Thomas Robitaille thomas.robitai

[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)

[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 =

[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=detailaid=2732455group_id=80706atid=560720 https://sourceforge.net/tracker/?func=detailaid=2723527group_id=80706atid=560720

[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

Re: [Matplotlib-users] imshow without resampling

2009-04-02 Thread Thomas Robitaille
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 thomas.robitai...@gmail.com wrote: Hello, I am using matplotlib to create postscript and SVG files. I am

[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:

Re: [Matplotlib-users] imshow without resampling

2009-03-31 Thread Thomas Robitaille
= 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 thomas.robitai...@gmail.com wrote: Hello, I am using matplotlib to create postscript and SVG

[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

Re: [Matplotlib-users] Rotating in imshow

2009-03-13 Thread Thomas Robitaille
= 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: Hello, I

Re: [Matplotlib-users] Rotating in imshow

2009-03-13 Thread Thomas Robitaille
: 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 many years now, and the equivalent to imshow is called PGGRAY (or PGIMAG). One

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 many years now, and the equivalent to imshow is called PGGRAY (or PGIMAG). One

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 (with different dimensions), but I do not want to interact with the current figure

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.set_autoscale_on(False) does not work

[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

[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

[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,

[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

[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