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 0.
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
Hi Miriam,
This case is a simple one for setting the axis ratios. You want to set
the aspect ratio to equal:
gca().set_aspect('equal')
after making your plot
Jon
On Mon, 2013-03-25 at 16:06 +0100, Miriam Degginger wrote:
> Hi all,
>
> I am working on a correlation chart with pyplot for a monit
the difficulty 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,
> >> >>
> >> >>
x27; option to set_aspect generates
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 annoyin
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')
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 imag
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,
>
&
Hi Darhas,
How did you invert the axis? I find that it works for me to do:
ax.plot(x1,y1)
ax2 = ax.twiny()
ax2.plot(x2,y2)
ax2.invert_xaxis()
Jon
On Wed, 2013-01-30 at 16:45 +, Dharhas Pothina wrote:
> Hi All,
>
>
> I'm trying to recreate some plots from a old 1970's era report. This
> is
0800, Sterling Smith wrote:
> Jon,
>
> What version of matplotlib do you have? According to
> http://matplotlib.org/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,
> >
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 scatt
e top
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
> wrote:
> Hi,
>
> I'm having some trouble with us
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
fiddli
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 Louder
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 lo
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 Stree
You might want to look at the python textwrap module. That can take
your labels and automatically wrap them at a certain column width. See
(in addition to the official python docs)
http://www.doughellmann.com/PyMOTW/textwrap/
Jon
On Fri, 2012-07-20 at 23:55 -0400, C M wrote:
> How possible woul
gt; On Tue, Jul 17, 2012 at 3:01 PM, Jonathan Slavin
> 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)
> co
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.
Rega
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
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 rais
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
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
plac
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 rectang
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
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 a
Finally found a solution for this -- actually just tried solution from
Piter_ 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
> > > To: matplotl
From: Michael Droettboom
> > 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
27;t work. In the context in which it's invoked to find the
font, 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
> wrote:
>
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
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 (contour
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
I believe).
> Can you try other version of ps2pdf?
>
> Regards,
>
> -JJ
>
>
>
> On Wed, Aug 17, 2011 at 9:53 PM, Jonathan Slavin
> wrote:
> > Attached are examples of the problem -- a PostScript file and the pdf
> > that is created using ps2pdf.
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 te
Can you post an output eps file so that we can take a look?
> Regards,
>
> -JJ
>
>
>
> On Wed, Aug 17, 2011 at 5:52 AM, Jonathan Slavin
> wrote:
> > Hi all,
> >
> > I've been making figures for a paper I'm writing (to be submitted to th
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 t
wever.
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:
> >
> > plt.cla()
>
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:
plt.cla()
fig = plt.gc
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 that
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
be
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
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
num
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
d
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, 1.5
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 more
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.
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 t
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 file
wrote:
> Hi Jonathan,
>
> On Fri, Aug 20, 2010 at 16:29, Jonathan Slavin
> 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
>
dgecolors(["none", "r"])
>
> will change the color of the first contour to "none" (i.e., not drawn)
> and the second one to red.
>
> But you need to figure out which one is the one you want.
>
> IHTH,
>
> -JJ
>
>
> On Tue, Jun 2
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 t
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
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
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 f
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 for
55 matches
Mail list logo