Re: [Matplotlib-users] Squashed axes with AxesGrid

2013-05-17 Thread Jonathan Slavin
Matthias, It's clear to me why apect='equal' doesn't work for you. That option means to give the axes equal scaling -- i.e., the ratio of length in axis units to length in the plot is the same for both axes, so that an axis that goes from 0 to 1 will be twice as long as one that goes from 0 to

[Matplotlib-users] tight_layout and ImageGrid

2013-05-08 Thread Jonathan Slavin
Hi, I wrote a short routine to look through a set of images that result from slightly different processing of the same data. I want to compare three different images and be able to zoom them all in the same way and then move onto the next set of three. The best way that I've found to do that so

[Matplotlib-users] set limits not obeyed for stacked plots when set_aspect('equal') used

2013-03-20 Thread Jonathan Slavin
Hi all, I've run across a minor but annoying bug. It can be demonstrated pretty simply: fig, ax = plt.subplots(2,1,sharex=True,figsize=(7.,7.)) fig.subplots_adjust(hspace=0.0) x = 4.25*(np.arange(6.) - 2.5)/10. y = 0.6*x/max(x) ax[0].plot(x,y) ax[0].set_xlim(-1.2,1.2) ax[0].set_aspect('equal')

Re: [Matplotlib-users] set limits not obeyed for stacked plots when set_aspect('equal') used

2013-03-20 Thread Jonathan Slavin
an exception, ValueError: adjustable must be datalim for shared axes Jon On Wed, 2013-03-20 at 11:25 -1000, Eric Firing wrote: On 2013/03/20 8:57 AM, Jonathan Slavin wrote: Hi all, I've run across a minor but annoying bug. It can be demonstrated pretty simply: fig, ax

Re: [Matplotlib-users] set limits not obeyed for stacked plots when set_aspect('equal') used

2013-03-20 Thread Jonathan Slavin
with panning and zooming. Jon On Wed, 2013-03-20 at 18:16 -0700, Brendan Barnwell wrote: On 2013-03-20 14:25, Eric Firing wrote: On 2013/03/20 8:57 AM, Jonathan Slavin wrote: Hi all, I've run across a minor but annoying bug. It can be demonstrated pretty simply

Re: [Matplotlib-users] Feedback on an implementation of a matlab-ish datacursor

2013-03-13 Thread Jonathan Slavin
Nevermind on my earlier question on artists and using datacursor. I figured that one out. What I did was basically (after creating the image and contours): artist = gca().images datacursor(artist) and it worked! Jon On Wed, 2013-03-13 at 15:50 -0400, Jonathan Slavin wrote: Joe, Thank you

Re: [Matplotlib-users] Feedback on an implementation of a matlab-ish datacursor

2013-03-13 Thread Jonathan Slavin
Joe, Thank you! I will especially use it to get the z value in images. I started to try to do something like this once but never finished. One thing I'm having a bit of trouble with is providing an artist as an argument. The reason I wanted to do that is to look only at the values for the

[Matplotlib-users] append to or concatenate PathCollection objects?

2013-01-23 Thread Jonathan Slavin
Hi, I'm wondering if there is some straightforward way to combine two PathCollection objects to create a new PathCollection object. My goal is to include two points that use different axes (one twin'ed to the other) into a single legend item (different point types, same label). Each call to

Re: [Matplotlib-users] append to or concatenate PathCollection objects?

2013-01-23 Thread Jonathan Slavin
/users/legend_guide.html what you say should be possible in 1.2.0. -Sterling On Jan 23, 2013, at 9:35AM, Jonathan Slavin wrote: Hi, I'm wondering if there is some straightforward way to combine two PathCollection objects to create a new PathCollection object. My goal

[Matplotlib-users] twiny and title

2013-01-22 Thread Jonathan Slavin
Hi, I'm having some trouble with using twiny and a title on the plot. The title is writing over the axis label -- and even the tick labels. I've tried tight_layout() but it doesn't seem to help. I could use fig.text instead of title and place the title text where I want it (with a bit of

Re: [Matplotlib-users] twiny and title

2013-01-22 Thread Jonathan Slavin
offset for the subplot to get the title to not overlap the axis label. Jon On Tue, 2013-01-22 at 13:02 -0800, Paul Hobson wrote: On Tue, Jan 22, 2013 at 12:22 PM, Jonathan Slavin jsla...@cfa.harvard.edu wrote: Hi, I'm having some trouble with using twiny and a title

Re: [Matplotlib-users] open circles aren't showing up in the legend box

2013-01-03 Thread Jonathan Slavin
Joe, I think the problem is the edgecolor='face' in the scatter call for the open circles. For me when I omit that, it all works. I'd also note that calling legend after draw results in the legend showing the circles correctly colored. Regards, Jon On Wed, 2013-01-02 at 16:46 -0800, Joe

Re: [Matplotlib-users] problems making grayscale lines

2012-10-02 Thread Jonathan Slavin
D'oh! Caught my mistake. I was thinking of the grayscale backwards. color = '1.0' is white not black! Got it working now. Jon -- __ Jonathan D. Slavin Harvard-Smithsonian CfA jsla...@cfa.harvard.edu 60 Garden

[Matplotlib-users] problems making grayscale lines

2012-10-02 Thread Jonathan Slavin
Hi all, I'm trying to make a plot with several lines, each with a different grayscale color. I thought I could do something like clrs = ['0.125', '0.25', '0.375', '0.5', '0.625', '0.75', '0.875', '1.0'] and then either set the color cycle using clrs or just use the color=clrs[i] argument in a

Re: [Matplotlib-users] mimic alpha (channel) v0.1

2012-07-18 Thread Jonathan Slavin
PM, Jonathan Slavin jsla...@cfa.harvard.edu wrote: Francesco, While I like your solution, there is an alternative that is simpler and works for me. That is 1) save matplotlib plot as a png, 2) convert to eps using either ImageMagick

[Matplotlib-users] mimic alpha (channel) v0.1

2012-07-17 Thread Jonathan Slavin
Francesco, While I like your solution, there is an alternative that is simpler and works for me. That is 1) save matplotlib plot as a png, 2) convert to eps using either ImageMagick or GraphicsMagick. You do end up with relatively large files, but they look identical to the original plots.

Re: [Matplotlib-users] customised linestyle?

2012-05-08 Thread Jonathan Slavin
The example here: http://matplotlib.sourceforge.net/examples/pylab_examples/dash_control.html?highlight=set_dashes will probably help. Jon See the API document of plot(): http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.plot You may try different combinations of

[Matplotlib-users] waitforbuttonpress DeprecationWarning

2012-04-03 Thread Jonathan Slavin
Hi, I've been writing a routine that interactively finds fitting limits. Some of the time it seems that doing draw() flushes the output to the figure and some of the time it doesn't. The only way I can reliably get it to do that is to insert a waitforbuttonpress into the code. However, this

[Matplotlib-users] matplotlib website problems?

2012-03-14 Thread Jonathan Slavin
Hi, Recently on several occasions I have gotten the response Too many requests, please try again later. when trying to go to a matplotlib webpage. Have others experienced this also? Is this a problem with sourceforge? I'm wondering what could be done about this. It's very annoying when, for

[Matplotlib-users] x and y labels that span multiple axes

2012-03-09 Thread Jonathan Slavin
Hi all, I'm plotting a set of subplots (2 x 3) and I'd like to label the x and y axes with one title each (i.e. spanning the axes) since the units of all the x axes and y axes are the same. I know that I can use fig.text to do it, though that would require some fiddling on my part to get the

Re: [Matplotlib-users] Why pixel marker size is 4 pixels?

2012-02-06 Thread Jonathan Slavin
Chris, You might want to try a module written by Tom Robitaille (aka astrofrog) called rasterized_scatter. Look for it on github. Jon On Mon, 2012-02-06 at 21:28 +0900, Jae-Joon Lee wrote: Thanks. Now I understand the situation. As far as I can see, marker=, is implemented as a rectangle

Re: [Matplotlib-users] cycling mechanism

2012-01-05 Thread Jonathan Slavin
Just one quick thought. I hope that you will implement a longer default color cycle than the current default. I have several times run into situations where I have to either modify the cycle or specify the colors manually because I had more than 7 lines. Also, it'd be nice to have the colors be

[Matplotlib-users] patheffects for Line2D objects

2011-12-19 Thread Jonathan Slavin
Hi, It seems that patheffects are not supported for Line2D objects currently - only for Text and Patch objects. Is there any fundamental reason they couldn't be extended to support Line2D objects? I'm interested in this because I draw grid lines for some hammer projection plots and those lines

Re: [Matplotlib-users] how to use different font for serif

2011-12-08 Thread Jonathan Slavin
Finally found a solution for this -- actually just tried solution from Piter_ x.pi...@gmail.com in his post -- deleted fontList.cache and it works. That is, just doing rcParams['font.family'] = 'Times New Roman' gives me that font as the default. Jon From: Michael Droettboom

Re: [Matplotlib-users] how to use different font for serif

2011-12-06 Thread Jonathan Slavin
From: Michael Droettboom md...@stsci.edu To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] how to use different font for serif Date: Mon, 5 Dec 2011 14:49:09 -0500 What rcParams are you setting? font.family: serif font.serif: Times New Roman and

Re: [Matplotlib-users] how to use different font for serif

2011-12-05 Thread Jonathan Slavin
, the font manager can't find it. So far I haven't been able to track down the problem. Jon On Fri, 2011-12-02 at 17:30 -0500, Tony Yu wrote: On Fri, Dec 2, 2011 at 4:13 PM, Jonathan Slavin jsla...@cfa.harvard.edu wrote: Hi all, I've been trying to use a different

[Matplotlib-users] how to use different font for serif

2011-12-02 Thread Jonathan Slavin
Hi all, I've been trying to use a different serif font for a plot and have been running into problems. I thought I could just do something like: from matplotlib import rc rc('font', family='serif', serif='Times New Roman') but if I try that I end up getting: findfont: Font family ['serif'] not

[Matplotlib-users] cross hatching in contours?

2011-09-15 Thread Jonathan Slavin
I'm wondering if there is some way to do cross hatching as a way to fill contours rather than colors (using contourf). The only references to cross hatching I see in the documentation are for patches type objects. As far as I can tell, contour and contourf return objects of their own type

Re: [Matplotlib-users] problem with contour labels with logarithmic axis

2011-09-13 Thread Jonathan Slavin
Answering my own question... It's a question of order. I needed to set_yscale('log') before calling clabel. Jon Hi all, I've run into a problem with a contour plot that has a logarithmic y-axis. The spacing around the inline contour label is too

Re: [Matplotlib-users] mathtext in eps figures doesn't come out in pdf

2011-08-19 Thread Jonathan Slavin
? Regards, -JJ On Wed, Aug 17, 2011 at 9:53 PM, Jonathan Slavin jsla...@cfa.harvard.edu wrote: Attached are examples of the problem -- a PostScript file and the pdf that is created using ps2pdf. The y-axis is properly labeled in the ps file, but the part of the label using

[Matplotlib-users] solution for eps figures and pdf output

2011-08-18 Thread Jonathan Slavin
Hi all, After trying several ways around this problem, I've found a solution that is pretty straightforward and produces nice results. The problem I'm referring to is that when I saved my figures as encapsulated PostScript for inclusion in a LaTeX document, the figures came out missing certain

Re: [Matplotlib-users] mathtext in eps figures doesn't come out in pdf

2011-08-17 Thread Jonathan Slavin
an output eps file so that we can take a look? Regards, -JJ On Wed, Aug 17, 2011 at 5:52 AM, Jonathan Slavin jsla...@cfa.harvard.edu wrote: Hi all, I've been making figures for a paper I'm writing (to be submitted to the ApJ). I'm using LaTeX and so need to use encapsulated

[Matplotlib-users] mathtext in eps figures doesn't come out in pdf

2011-08-16 Thread Jonathan Slavin
Hi all, I've been making figures for a paper I'm writing (to be submitted to the ApJ). I'm using LaTeX and so need to use encapsulated PostScript for the figures. The problem is that when the paper is translated to pdf from PostScript, the mathtext in the figures disappears. The reason that I

Re: [Matplotlib-users] forcing prompt draw

2011-06-27 Thread Jonathan Slavin
. Jon On 06/24/2011 04:03 AM, Jonathan Slavin wrote: import matplotlib.pyplot as plt plt.ion() fig = plt.gcf() for obsid in obsids: do fitting plt.cla() fig = plt.gcf() ax = fig.add_axes

[Matplotlib-users] forcing prompt draw

2011-06-24 Thread Jonathan Slavin
To all: I'm doing a series of fits and want to display the results of each in a figure before I go to the next one. I currently do roughly something like this (with a lot left out): import matplotlib.pyplot as plt plt.ion() fig = plt.gcf() for obsid in obsids: do fitting plt.cla()

[Matplotlib-users] imshow in Axes3D?

2011-05-10 Thread Jonathan Slavin
Hi, I would like to create a plot with a series of parallel 2-D slices in order to illustrate 3-D data. I got excited when I saw the example of translucent bar plots, which is similiar in some ways to what I had in mind. But it seems that there is no imshow method in Axes3D. How hard would

[Matplotlib-users] how to scale colorbar size to image size?

2011-04-11 Thread Jonathan Slavin
Hi all: I'm looking for a simple way to scale a color bar so it will be the same height as the image. It seems to work automatically if the image is at least as tall as it is wide, but when it is wider than tall it seems to scale to the width rather than height. (Shouldn't the default behavior

[Matplotlib-users] getting minor ticks by default

2010-10-22 Thread Jonathan Slavin
Is there some way to get minor tick marks on plots by default? I can do: plt.minorticks_on() easily enough, but it seems that there is no setting I can put in my matplotlibrc file that will give me them by default. Is that right? Jon

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread Jonathan Slavin
I think that'd be fine -- i.e. the option of \cdot or \times (though in the gmane preview the dot looks a bit low). In the mean time, I came up with the method below that worked for my purpose. Jon import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import FuncFormatter

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread Jonathan Slavin
Friedrich, Our e-mails crossed. I don't think the numbers need to have the same exponent. I would go with (d) as my example does. The more difficult part to my mind is the number of significant digits to use. The current code that determines whether to use an offset or not must look at the

[Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-18 Thread Jonathan Slavin
Hi, I'm wondering if there's some relatively automatic way to have the ticklabels to come out in scientific notation for an axis that uses a linear scale (and has a range that warrants scientific notation)? For example, an axis that goes from 0 to 2.E18 by default uses the labels 0, 0.5, 1.0,

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread Jonathan Slavin
This is interesting. It seems that the event.x, event.y values are for the entire figure area rather than limited to the image. Anyone know how to get the image values instead? Also, I wonder how one might get the values of the pixels (i.e. image value) at the pixels that you click on. One

Re: [Matplotlib-users] convert figure from color to BW/grayscale

2010-09-20 Thread Jonathan Slavin
A non-matplotlib way to do this is to use ImageMagick or GraphicsMagick: gm convert -colorspace Gray color_image.png bw_image.png in GraphicsMagick or using the ImageMagick routine convert: convert -colorspace Gray color_image.png bw_image.png I think it works on a wide variety of image formats.

Re: [Matplotlib-users] Line changes color along its length

2010-09-08 Thread Jonathan Slavin
This is of interest to me, and it's nice to know that this is do-able with matplotlib, but like many of the examples, I find it sorely lacking in documentation. For example, why are the points and segments arrays shaped so specifically the way they are? Why the call to set_array? Could the same

Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Jonathan Slavin
This is starting to get off topic from matplotlib, but it is relevant to creating good EPS figures... When using ImageMagick to transform from to an EPS, your results will be much improved by using the parameter -density 288. This increases the resolution (and thus results in a much bigger

Re: [Matplotlib-users] plotting open symbols

2010-08-20 Thread Jonathan Slavin
: Hi Jonathan, On Fri, Aug 20, 2010 at 16:29, Jonathan Slavin jsla...@cfa.harvard.edu wrote: To all: I'm wondering if there is any way to make plots with open symbols, e.g. a circle. I know how to use markers that look open, e.g. by doing something like, plot(x,y,marker='o',mfc='w

Re: [Matplotlib-users] selecting part of a contour to plot

2010-06-23 Thread Jonathan Slavin
to red. But you need to figure out which one is the one you want. IHTH, -JJ On Tue, Jun 22, 2010 at 2:46 PM, Jonathan Slavin jsla...@cfa.harvard.edu wrote: To all: I'm making a plot with an image and a contour on it. I use only one level in the call to contour

[Matplotlib-users] selecting part of a contour to plot

2010-06-22 Thread Jonathan Slavin
To all: I'm making a plot with an image and a contour on it. I use only one level in the call to contour, but it results in two distinct contours, an inner closed one and an outer open one. I want to plot only the outer piece. How might I go about that? I've been looking at the properties of

[Matplotlib-users] How to make 3-D axes/grid more visible?

2010-06-17 Thread Jonathan Slavin
I've been using Axes3D to make plots and I like the output very much -- with the one exception being the faintness of the 3-D grid that is put in the background. The light gray used is quite difficult to see. Is there some way to specify the color of the grid and/or background? I'd be satisfied

[Matplotlib-users] defining/saving contours without plotting

2010-01-27 Thread Jonathan Slavin
To matplotusers: I want to create a plot that has an image and overplots contours, but the contours are defined relative to different data from that plotted in the image. Is there a way to save contour line data rather than plot it. It just occurred to me a way of creating the plot -- but I'm

Re: [Matplotlib-users] Adding points gradually to the plot

2010-01-13 Thread Jonathan Slavin
Instead of appending the points to xs and ys and doing plot(xs,ys) each time, why not just do plot(x,y)? If you want to save the data in the xs, ys arrays you can do that without replotting the entire array. Jon On Wed, 2010-01-13 at 10:14 -0800, Someday... wrote: Hello all, I am looking for

[Matplotlib-users] contour plots with logarithmic axes

2010-01-11 Thread Jonathan Slavin
Is there any way to simply make a contour plot with logarithmic axes using matplotlib? I found a workaround by plotting log10(x), log10(y), but it'd be nicer if it was more direct. As someone new to matplotlib (experienced in IDL) I'm finding much to like, but some things are more difficult