will
make it a bit for performant if you use bliting (which does not work with
nbagg currently)
Sorry I missed that part of the question first time through.
Tom
On Sun, Apr 12, 2015, 08:31 Ryan Nelson rnelsonc...@gmail.com wrote:
Tom,
Thanks for the links. It does seem like fragments of my
xnview says it is 128*128*8, but print
imread('python-gray.png').shape says (128, 128, 3), however I suppose
it should be (128, 128)!
Not sure that this is true, but I guess that xnview is using the third
dimension here to refer to a number of bytes. In this case, it is two
bytes, one for
, 2015 at 8:18 AM, Ryan Nelson rnelsonc...@gmail.com
wrote:
Tom,
Thanks for the code. As it was given, I had to change `blit=True` in the
`FuncAnimation` call in order to get this to work in a regular Qt backend.
It did not work with the nbagg backend; however, if I used this code it
works fine
Oops. I meant bits not bytes in my earlier statements. Sorry.
On Thu, Apr 16, 2015 at 11:24 AM, Ryan Nelson rnelsonc...@gmail.com wrote:
xnview says it is 128*128*8, but print
imread('python-gray.png').shape says (128, 128, 3), however I suppose
it should be (128, 128)!
Not sure
a given condition is an interesting idea, but I think that
means the animation objects needs to have a public 'stop' method first!
Tom
On Fri, Apr 10, 2015 at 3:00 PM Ryan Nelson rnelsonc...@gmail.com wrote:
Good afternoon, all!
I'm really digging the nbagg backend, and I'm trying to use
Prahas,
You're example is a little strange because when I set `x0 = (-1,0,0.5)`,
your function works fine on Python 2. Are you trying to set t0?
Note, your function does not compile on Python 3. You should try to be more
explicit with that first argument in that function. For example, does the
requires the addition of BytesIO
and read(). I take it that this is not supposed to be the case.
Ryan
On Fri, Mar 20, 2015 at 11:48 AM, Ryan Nelson rnelsonc...@gmail.com wrote:
Thanks, Ben. I should have made that more clear. If I run the code from
the PR, I get the following error:
Traceback (most
and up. Are you
saying that you still can't do imread(urllib.request.urlopen(url))?
On Thu, Mar 19, 2015 at 8:54 PM, Ryan Nelson rnelsonc...@gmail.com
wrote:
Hello all,
I'm porting over some code that used Py2.7 urllib2.urlopen(url) to grab
some image data from the net and load
internally.
Thanks
Ryan
On Fri, Mar 20, 2015 at 12:24 PM, Thomas Caswell tcasw...@gmail.com wrote:
I think `six` (which we use to smooth over the 2/3 changes) has a way of
dealing with atleast the urllib renaming .
On Fri, Mar 20, 2015 at 11:58 AM Ryan Nelson rnelsonc...@gmail.com
wrote
works
* on Gentoo Linux Python 2.7 and 3.4, MPL 1.4.3 -- only the 2.7 version
works
Hope that helps.
Ryan
On Fri, Mar 20, 2015 at 3:41 PM, Jerzy Karczmarczuk
jerzy.karczmarc...@unicaen.fr wrote:
Le 20/03/2015 16:57, Ryan Nelson a écrit :
For me, if I change the script from the PR to what
Thomas, sorry I missed your email.
I'll see if I can get a PR pulled together soon-ish.
Ryan
On Fri, Mar 20, 2015 at 4:32 PM, Ryan Nelson rnelsonc...@gmail.com wrote:
A little update. It seems that this seems to be specific to Linux in some
way. I tried the original script from the PR under
Hello all,
I'm porting over some code that used Py2.7 urllib2.urlopen(url) to grab
some image data from the net and load with pyplot.imread. It doesn't work
quite right in Py3.4. I found a couple of refs:
https://github.com/matplotlib/matplotlib/pull/1650
...@gmail.com
wrote:
Yes, a popup window appears but it appears immediately after it appears.
On 14/03/2015 10:03 PM, Ryan Nelson wrote:
Brenton,
Unfortunately, those particular examples are out of date. First of all,
I would not recommend using pylab at all -- and I think that many other
folks
:
On 14/03/2015 10:31 PM, Ryan Nelson wrote:
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.show()
That works fine.
And
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
plt.ion()
plt.plot([1,2,3
I'm constructing a multi-plot figure using an IPython notebook (v3) and
matplotlib (v1.4.3) inline magic. I was manually setting the axes bounds,
and I ended up with something like the following:
import matplotlib.pyplot as plt
%matplotlib inline
bottom = 0.12
top = 0.9
left = 0.12
, 2015 1:59 PM, Ryan Nelson rnelsonc...@gmail.com wrote:
I'm constructing a multi-plot figure using an IPython notebook (v3) and
matplotlib (v1.4.3) inline magic. I was manually setting the axes bounds,
and I ended up with something like the following:
import matplotlib.pyplot as plt
/1109)
Tom
On Fri, Mar 13, 2015 at 3:01 PM Ryan Nelson rnelsonc...@gmail.com wrote:
I'm constructing a multi-plot figure using an IPython notebook (v3) and
matplotlib (v1.4.3) inline magic. I was manually setting the axes bounds,
and I ended up with something like the following
Sometimes a simple text file really does the trick... However, you might
consider saving yourself some future pain by learning some non-text based
storage formats. In the past, I used text files all the time, and they
quickly became limiting, as you've noticed.
I personally like HDF files. There
that answers that! Thanks, I didn't think
to check this.
Julian
On Sun, Feb 22, 2015 at 10:53 AM, Ryan Nelson rnelsonc...@gmail.com
wrote:
Julian,
What version of matplotlib are you using? The attached rc file works fine
for me with MPLv1.4.2.
Ryan
On Sat, Feb 21, 2015 at 11:56 PM
Tom et al.,
I don't know about this exact application... However, a couple of months
ago, I asked on the Scipy mailing list about updating the Scipy cookbook
page for Qt/Matplotlib (
http://wiki.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer),
but I never got a response. The cookbook
I don't have an answer to your question exactly. But I'll just say that
this does make sense. The aspect-corrected axes (after show) is a subset of
what you originally asked for, i.e. the bottom is higher, and the height is
smaller. My guess is that this is not calculated until the final rendering
Hello list,
A couple months ago, I spent quite a bit of time trying to figure out how
to use Qt designer create a GUI with an embedded MPL window. Unfortunately,
the Scipy cookbook page (
http://wiki.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer) is
very outdated. A recent post (
Tom and other devs,
Thanks for all the hard work! Looking forward to making the upgrade.
Just curious if there is a detailed roadmap for v2 and beyond. I feel like
there have been some rumors that the get/set architecture will be
deprecated at some point.
Ryan
On Tue, Feb 17, 2015 at 4:30 AM,
Tommy, (Sorry for the doubleup. I just realized I forgot to hit reply-all.)
Do you want to remove the tick at 0 and only have 5,10, etc.? Could you
just do something like this instead:
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
fig = plt.figure()
ax1 =
But that then overrides this:
ax1.xaxis.set_major_locator(MultipleLocator(5))
On Sat, Feb 14, 2015 at 5:27 PM, Ryan Nelson rnelsonc...@gmail.com
wrote:
Tommy, (Sorry for the doubleup. I just realized I forgot to hit
reply-all.)
Do you want to remove the tick at 0 and only have 5,10, etc.? Could
at 1:31 AM, Ryan Nelson rnelsonc...@gmail.com
wrote:
Tommy,
You are probably looking for pyplot.xticks. For example, you might want
something along these lines:
import matplotlib.pyplot as plt
plt.plot([1,3,2])
# We'll do this to get the autogenerated positions
ticks, labels
the easiest thing to do.
On Sat, Feb 14, 2015 at 7:01 PM, Ryan Nelson rnelsonc...@gmail.com
wrote:
Tommy,
I'm sorry. I forgot to hit send all *again*. Below is my original
message,
but the function I wrote is updated because it wasn't exactly correct
Ah. I was working on something
():
label.set_horizontalalignment('right')
ax2.tick_params(pad=20)
When the numbers are large, then they are glued to the secondary
y-axis. When they are small, then they are hovering far away from it.
On Sat, Feb 14, 2015 at 7:20 PM, Ryan Nelson rnelsonc...@gmail.com
wrote:
You're welcome, Tommy. I used gnuplot
= _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named matplotlib.pyplot
I'm not sure what the first command is to confirm whether a module is
installed or not, but it looks like I may need that.
Thanks, Ben and Ryan.
John
On 2/12/2015 10:09 AM, Ryan Nelson wrote
John,
As Ben said, the QGIS Windows installer comes with its own Python
installation, which doesn't know anything about any other Python install.
Unfortunately, this apparently makes it rather difficult to install other
packages. However, QGIS Python already contains Numpy and Matplotlib and
Denis,
I've only made simple polygons with MPL, so I don't know the full
capabilities. However, there is another package called Shapely that can
construct polygons like you've defined:
http://toblerity.org/shapely/manual.html#polygons
It also does some set-type stuff, such as intersections,
.
Ben Root
On Mon, Dec 8, 2014 at 6:14 PM, Ryan Nelson rnelsonc...@gmail.com wrote:
Final update.
I've done some more searching, and found a couple more things. It seems
that this problem occurs with the backend set to Agg
(`matplotlib.use(agg)), so it isn't related to the interactive
Hello all,
I'm having an issue with fill_between. It seems that setting the keyword
`linewidth=0` removes the entire patch, rather than the just the bounding
lines. Example:
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 2*np.pi, 1000)
y = np.sin(x)
Update.
This is a problem also in Anaconda Py3.4 with MPL 1.4.2, but it works
without a problem on MPL 1.4.0.
Ryan
On Mon, Dec 8, 2014 at 12:15 PM, Ryan Nelson rnelsonc...@gmail.com wrote:
Hello all,
I'm having an issue with fill_between. It seems that setting the keyword
`linewidth=0
matplotlib.pyplot as plt
x = np.linspace(0, np.pi*2, 1000)
y = np.sin(x)
ax = plt.axes()
fill = ax.fill_between(x, y-0.1, y+0.1)
fill.set_linewidth(0)
plt.show()
On Mon, Dec 8, 2014 at 3:38 PM, Ryan Nelson rnelsonc...@gmail.com wrote:
Update.
This is a problem also in Anaconda Py3.4 with MPL
])
#col.set_linewidth(0.0)
#ax.add_collection(col)
plt.axis([-2, 2, -2, 2])
plt.savefig('junk')
#
On Mon, Dec 8, 2014 at 5:02 PM, Ryan Nelson rnelsonc...@gmail.com wrote:
Update 2.
I made a new Anaconda Python 2.7 environment and cycled through some
different MPL versions. Everything works as I would
Raffaele,
As Ben pointed out, you might be creating a lot of in memory Numpy arrays
that you probably don't need/want.
For example, I think (?) slicing all of the variable below:
lons = fh.variables['lon'][:]
is making a copy of all that (mmap'ed) data as a Numpy array in memory. Get
rid of the
)
par2.axis[right].major_ticklabels.set_fontsize(14)
plt.show()
##
Hope that helps.
Ryan
On Tue, Oct 29, 2013 at 5:54 AM, Daniele Nicolodi dani...@grinta.netwrote:
On 29/10/2013 03:11, Ryan Nelson wrote:
Daniele,
I noticed the same problem with the Qt backend. However
Daniele,
I noticed the same problem with the Qt backend. However, I was looking at
the documentation on the AxesGrid webpage here:
http://matplotlib.org/mpl_toolkits/axes_grid/users/overview.html
And I see the following warning:
axes_grid and axisartist (but not axes_grid1) uses a custom Axes
Dilpreet,
Fortunately, you have a couple of options here. First of all, when you call
the plt.hist function, it actually returns three useful sets of data: the
frequencies, bin edges, and the bar patches. The first two are probably
what you want. You can grab those for later use in your code by
You might need to explicitly specify your axes object rather than
relying on plt.subplot.
Try replacing 'ax = plt.sublplot(111)' with 'ax = plt.axes([0, 0, 1, 1])'.
Ryan
On 7/5/2013 12:44 PM, death jun wrote:
Hello list,
I have LineCollection object: l =
cannot get the colorbar to work.
I tried
sc = ax.add_collection(col)
plt.colorbar(sc)
and
plt.colobar(col)
both do not work.
Any Ideas how to fix those two issues?
Thanks,
-Hackstein
Message: 4
Date: Thu, 25 Apr 2013 19:44:23 -0400
From: Ryan Nelson rnelsonc...@gmail.com
Hackstein,
Unfortunately, I'm not sure of an 'elegant' way to do what your asking
with a single call to scatter. Others may know a better way. However,
you can use rectangle patches and patch collections. (Requires a bit
more code than scatter but is ultimately more flexible.)
I think the
I'm not sure that I understand exactly what you are trying to do, but
you may want to look into Matplotlib annotation. Here's a really quick
example:
import matplotlib.pyplot as plt
plt.annotate('', (1, 1), (0, 0),
arrowprops=dict(facecolor='black'))
plt.axis([-1, 2, -1, 2])
plt.show()
On 2/25/2013 9:29 PM, Gökhan Sever wrote:
Hello,
For some reason, I can't get the degree sign showing up in my ps output:
Here is the simple test code:
fp = plt.figure(figsize=(8.5, 11))
fp.text(0.5, 0.5, uTemperature, ^(0)C, color='black', fontsize=16)
plt.savefig('test.ps http://test.ps',
On 2/24/2013 1:28 PM, Paul Anton Letnes wrote:
Hi everyone,
I've been looking into making an animation of a mechanical system. In its
first incarnation, my plan was as follows:
1) Make a fading line plot of two variables (say, x and y)
2) Run a series of such plots through ffmpeg/avencode
Andreas,
Perhaps you would be better off making your own colormap considering that
your data is not symmetric around zero. You could do something like the
following:
--
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as plc
data =
As far as I know, the 'arrow' function is not recommended. The 'annotate'
function has a lot more features. Here's your code with the annotate
function:
import pylab
from scipy import optimize
import numpy
x1=numpy.arange(-4000,1000,0.1)
x2=numpy.arange(-1000,4000,0.1)
Mike,
You may want to look into the matplotlib.cm and matplotlib.colors modules.
I've had good success with matplotlib.colors.LinearSegmentedColormap and its
'from_list' method. The documentation is the best location for information
on this topic. If you have a large number of locations, then the
Mike, sorry to send this twice... I should have sent it to the list as
well...
___
Mike,
If your locations were integers or floats rather than strings, you could
just change the scatter call to the following:
ax.scatter(dates,IDs,c=
locations,marker='d')
I don't know
Rob,
Have you tried the zorder argument. It is an integer that controls the
relative 'height' of a plotting element: higher numbers are plotted over
lower numbers. For example, the following code plots the scatter points on
top of the plotted line (even though scatter was called first):
import
Hello all,
I noticed some unusual behavior with specific combinations of axes.twinx and
pyplot.xticks. It seems that under certain conditions, the pyplot.xticks
command can cause an x offset of the plots. Here's a relatively short
example (as written, this works fine):
import numpy as np
import
If I understand your question correctly, I may have a solution to your
problem. First of all, the statement below, when converted to Python
code, will generate an array of numbers the same length of your masses list.
'y runs fron 0 to n where n == len(masses) '
However, this statement will give
Hello everyone,
I frequently use subscripts and superscripts in text on my plots, but
I've noticed that the line and character spacing (kerning ?) is not
always as I would expect. For most things, this is not a problem.
However, I would occasionally like various text objects to line up with
54 matches
Mail list logo