Re: [Matplotlib-users] New tutorial (beginner level)

2012-08-13 Thread Fernando Perez
Hi Ben,

On Sat, Aug 11, 2012 at 8:30 AM, Benjamin Root  wrote:
> I have said this before, and it can't be repeated often enough.  The work
> that you and your team has been doing the past few years with the notebook
> is *already* revolutionizing how we teach python.  10 years from now,
> programmers will point to this as the *killer* feature of python.

well, your kind words are very much appreciated, truly.  It's been a
ton of work, and at this point far more credit goes to the rest of the
team than to me.

One thing I'd like to emphasize is how strong, productive and positive
the collaboration between IPython and matplotlib has been over time:
we have managed to allow both projects to fully retain their identity
(we don't even have a hard dependency on mpl in IPython, and
matplotlib doesn't even import IPython at all), and yet the two
projects complement each other very well, benefiting both of them, and
ultimately all of our users.  A good combination of communication and
collaboration has allowed us to maintain a strong separation of
concerns while providing users a feel of integrated functionality
where it matters.

I have every reason to believe that, as we push into the second decade
of this effort with the vision of challenges and ideas that John and
Michael D. recently laid out (at the SciPy'12 keynote and in Michael's
posts), this is only going to get better.  The web work is going to be
a pretty tough challenge, but at the same time it's a great
opportunity to revisit key parts of matplotlib with a lot of hindsight
we've accumulated.

That kind of hindsight is what let us refactor all of IPython over the
last few years, so that while the user experience at the terminal from
0.10 to 0.11 remained mostly unchanged (we did have some regressions
but they were pretty mild), we had a completely new architecture under
the hood that paved the way for the qt console, the notebook and the
current parallel machinery.  I hope we'll see similar benefits as the
web forces us to rethink matplotlib for a multiprocess model.

Cheers,

f

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Stride size in mplot3d

2012-08-13 Thread Damon McDougall
On Sun, Aug 12, 2012 at 01:23:35PM -0700, jonasr wrote:
> Hello, 
> 
> i am working on some 3d stuff with plot_surface() , my problem is that  i
> want to use a stride smaller then 1.

The stride refers to the *array* stride. So a stride of < 1 makes no
sense.

> Since my data is only on an intervall from -1 to 1, in x and in y direction
> i want to plot a 3d grid with at least 20 lines in each direction, is there
> a possibility to do this ?

An rstride of 1 will plot every row. A cstride of 3 will plot every 3rd
column. If your data is in a 2D array of dimensions 100x100, say, then
setting rstride=5 and cstride=5 will plot every 5th row and every 5th
column, giving 20 lines in each direction. The kwargs rstride and
cstride do not care about the domain of your data.

Hope this helps.

-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Saving figure with an image and a time axis as an EPS shifts image relative to other plot features

2012-08-13 Thread Benjamin Root
On Thu, Aug 2, 2012 at 7:21 PM, Chad Parker wrote:

> Hello everyone-
>
> I'm a new Python/Matplotlib user, but I have quite a bit of plotting
> experience with octave/matlab and gnuplot. So, I apologize in advance if my
> python style is terrible and if I give you all the wrong information!
>
> I'm having a problem saving figures that contain images as eps files when
> my x-axis is a date/time axis. The trouble is that in the resulting eps
> file, the image data is shifted relative to the axis. I've attached two
> images as an example. In the .png file the alignment is correct and in the
> eps file it's not. The png is also nearly identical to what I get when I
> plot to the screen. The script I wrote to generate these plots is at the
> end of this message.
>
> It's worth noting that the two output images are identical if the x-axis
> is simply numerical and not a time series.
>
> I'm using python 2.7.3 and Matplotlib 1.1.0
>
> Some Google searches dug up this old thread, however, the shift that I'm
> experiencing seems to be much greater, so I don't know if it's related:
> http://old.nabble.com/Saving-as-eps-file-shifts-image--td29232680.html
>
> Can anyone help me solve this?
> Thanks in advance,
> --Chad
>
>
> Here is a minimal script that I used to generate these plots:
>
> import matplotlib.pyplot as plt
> import matplotlib.dates as dts
> from matplotlib.colors import LogNorm
>
> imgData = [[1.0/x + 1.0/y for x in range(1,100)] for y in range(1,100)]
>
> tMin=dts.epoch2num(1343947266)
> tMax=dts.epoch2num(1343947266+100)
>
> axImg=plt.subplot(111)
> axImg.imshow(imgData, norm=LogNorm(),extent=(tMin,tMax,1,100),\
> interpolation='none', origin="upper")
> axImg.xaxis_date()
> axImg.set_aspect('auto')
>
> plt.savefig("imageshift.png")
> plt.savefig("imageshift.eps")
>
>
Confirmed.  This is a fairly nasty-looking result.  And I am not exactly
sure what is happening here.  Note that it does not matter if the png or
the eps images were saved first.  It looks like an auto-scaling bug, but
given that it doesn't impact the png image, I am not so sure.

Could you file a bug report on this at the github tracker?  I would like to
see this fixed before the 1.2.0 release.

Thanks!
Ben Root
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users