Re: [Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread Benjamin Root
Thomas described the work-around and provided a link. Put both of the
legends on the second axes. It is a kludge, for sure, but it is all you can
do.

On Wed, Mar 11, 2015 at 10:58 AM, liu lily politoeso...@gmail.com wrote:

 thanks,
 then are there any workaround on my case?
 or are there any other libaries which I CAN use to plot and manipulate the
 GUI?

 On Wed, Mar 11, 2015 at 3:54 PM, Benjamin Root ben.r...@ou.edu wrote:

 By top he means whichever axes was added most recently. When twining,
 the new axes is added on top of the original axes.

 I hope that clears it up.

 Ben Root

 On Wed, Mar 11, 2015 at 10:05 AM, liu lily politoeso...@gmail.com
 wrote:

 I dont understand
 you say it is the first axe
 but why in my case, only the second legend is draggable? it is in the
 second axe

 besides, since I have to use both y-axis on the left and on the right,
 it seems I have to have two axes,
 are there any workarounds? thanks!

 On Wed, Mar 11, 2015 at 2:22 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 The mouse events only propagate to the top axes.  You will have to add
 both legends to the same (top) axes.

 See http://matplotlib.org/users/legend_guide.html#multiple-legend


 Tom
 On Wed, Mar 11, 2015, 08:57 liu lily politoeso...@gmail.com wrote:

 Hi, all:

 I have two legends, as below, I find that I can't drag the first
 legend, what is the problem? how to deal with it? thanks!

 import matplotlib.pyplot as plt

 fig1, ax1 = plt.subplots()
 ax2 = ax1.twinx()

 ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
 ax2.plot([1,2,3],[5,6,7],'ro', label=two)

 leg1 = ax1.legend()
 leg2 = ax2.legend()

 leg1.draggable(state=True)
 leg2.draggable(state=True)
 plt.show()

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join
 the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread liu lily
thanks,
then are there any workaround on my case?
or are there any other libaries which I CAN use to plot and manipulate the
GUI?

On Wed, Mar 11, 2015 at 3:54 PM, Benjamin Root ben.r...@ou.edu wrote:

 By top he means whichever axes was added most recently. When twining,
 the new axes is added on top of the original axes.

 I hope that clears it up.

 Ben Root

 On Wed, Mar 11, 2015 at 10:05 AM, liu lily politoeso...@gmail.com wrote:

 I dont understand
 you say it is the first axe
 but why in my case, only the second legend is draggable? it is in the
 second axe

 besides, since I have to use both y-axis on the left and on the right, it
 seems I have to have two axes,
 are there any workarounds? thanks!

 On Wed, Mar 11, 2015 at 2:22 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 The mouse events only propagate to the top axes.  You will have to add
 both legends to the same (top) axes.

 See http://matplotlib.org/users/legend_guide.html#multiple-legend


 Tom
 On Wed, Mar 11, 2015, 08:57 liu lily politoeso...@gmail.com wrote:

 Hi, all:

 I have two legends, as below, I find that I can't drag the first
 legend, what is the problem? how to deal with it? thanks!

 import matplotlib.pyplot as plt

 fig1, ax1 = plt.subplots()
 ax2 = ax1.twinx()

 ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
 ax2.plot([1,2,3],[5,6,7],'ro', label=two)

 leg1 = ax1.legend()
 leg2 = ax2.legend()

 leg1.draggable(state=True)
 leg2.draggable(state=True)
 plt.show()

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread Benjamin Root
By top he means whichever axes was added most recently. When twining,
the new axes is added on top of the original axes.

I hope that clears it up.

Ben Root

On Wed, Mar 11, 2015 at 10:05 AM, liu lily politoeso...@gmail.com wrote:

 I dont understand
 you say it is the first axe
 but why in my case, only the second legend is draggable? it is in the
 second axe

 besides, since I have to use both y-axis on the left and on the right, it
 seems I have to have two axes,
 are there any workarounds? thanks!

 On Wed, Mar 11, 2015 at 2:22 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 The mouse events only propagate to the top axes.  You will have to add
 both legends to the same (top) axes.

 See http://matplotlib.org/users/legend_guide.html#multiple-legend


 Tom
 On Wed, Mar 11, 2015, 08:57 liu lily politoeso...@gmail.com wrote:

 Hi, all:

 I have two legends, as below, I find that I can't drag the first legend,
 what is the problem? how to deal with it? thanks!

 import matplotlib.pyplot as plt

 fig1, ax1 = plt.subplots()
 ax2 = ax1.twinx()

 ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
 ax2.plot([1,2,3],[5,6,7],'ro', label=two)

 leg1 = ax1.legend()
 leg2 = ax2.legend()

 leg1.draggable(state=True)
 leg2.draggable(state=True)
 plt.show()

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Lorenz -- another Q

2015-03-11 Thread Prahas David Nafissian
Hi,

Given the Lorenz code shared yesterday, is there a way
to generate a log file of the x,y,z points generated?

Thanks in advance.

--Prahas

In case you deleted the code:


import numpy as np
from scipy import integrate

from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import cnames
from matplotlib import animation

# orig value of N_traj was 20 -- very cool this way.

N_trajectories = 1

def lorentz_deriv((x, y, z), t0, sigma=10., beta=8./3, rho=28.0):
Compute the time-derivative of a Lorentz system.
return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]

# Choose random starting points, uniformly distributed from -15 to 15

np.random.seed(1)

# changing from -15,30 to 10,5 below starts the drawing in the middle,
# rather than getting the long line from below
# if using N_Traj  1, return to orig values.

# x0 = -15 + 30 * np.random.random((N_trajectories, 3))

x0 = 10 + 5 * np.random.random((N_trajectories, 3))


# Solve for the trajectories

# orig values:  0,4,1000
# 3rd value -- lower it, it gets choppier.
# 2nd value -- increase it -- more points, but speedier.

# change middle num from 4 to 15 -- this adds points

t = np.linspace(0, 40, 3000)
x_t = np.asarray([integrate.odeint(lorentz_deriv, x0i, t)
  for x0i in x0])

# Set up figure  3D axis for animation
fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1], projection='3d')

# changing off to on below adds axises.  slows it down but you
# can fix that with interval value in the animation call

ax.axis('on')

# choose a different color for each trajectory
colors = plt.cm.jet(np.linspace(0, 1, N_trajectories))

# set up lines and points -- this is a correction from
# the orig jake code.  the next four lines...

lines = [ax.plot([], [], [], '-', c=c)[0]
for c in colors]
pts = [ax.plot([], [], [], 'o', c=c)[0]
for c in colors]

# prepare the axes limits
ax.set_xlim((-25, 25))
ax.set_ylim((-35, 35))
ax.set_zlim((5, 55))

# set point-of-view: specified by (altitude degrees, azimuth degrees)
ax.view_init(30, 0)

# initialization function: plot the background of each frame
def init():
for line, pt in zip(lines, pts):
line.set_data([], [])
line.set_3d_properties([])

pt.set_data([], [])
pt.set_3d_properties([])
return lines + pts

# animation function.  This will be called sequentially with the frame number
def animate(i):
# we'll step two time-steps per frame.  This leads to nice results.

i = (2 * i) % x_t.shape[1]

for line, pt, xi in zip(lines, pts, x_t):
x, y, z = xi[:i].T
line.set_data(x, y)
line.set_3d_properties(z)

pt.set_data(x[-1:], y[-1:])
pt.set_3d_properties(z[-1:])

# changed 0.3 to 0.05 below -- this slows the rotation of the view.
# changed 30 to 20 below
# changing 20 to (20 + (.1 * i)) rotates on the Z axis.  trippy.

ax.view_init(10, 0.1 * i)
# ax.view_init(10, 100)
fig.canvas.draw()
return lines + pts

# instantiate the animator.  I've deleted the blit switch (for Mac)
# enlarging frames=500 works now -- it failed before because I didn't give it
# enough data -- by changing the t=np.linspace line above I generate
more points.
# interval larger slows it down
# changed inteval from 30 to 200, frames from 500 to 3000

anim = animation.FuncAnimation(fig, animate, init_func=init,
   frames=3000, interval=200)

# Save as mp4. This requires mplayer or ffmpeg to be installed. COMPLEX!
# Instead, use a screen record program:  Quicktime on the Mac; MS
Expression Encoder on PC.
# anim.save('PDNlorentz_attractor.mp4', fps=15, extra_args=['-vcodec',
'libx264'])

plt.show()

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread Thomas Caswell
As I said in the first email, you need to put both legend artists on the
top axes.  The link is to the documentation on _how_ to put more than one
legend in the same axes.

Tom

On Wed, Mar 11, 2015 at 10:58 AM liu lily politoeso...@gmail.com wrote:

 thanks,
 then are there any workaround on my case?
 or are there any other libaries which I CAN use to plot and manipulate the
 GUI?

 On Wed, Mar 11, 2015 at 3:54 PM, Benjamin Root ben.r...@ou.edu wrote:

 By top he means whichever axes was added most recently. When twining,
 the new axes is added on top of the original axes.

 I hope that clears it up.

 Ben Root

 On Wed, Mar 11, 2015 at 10:05 AM, liu lily politoeso...@gmail.com
 wrote:

 I dont understand
 you say it is the first axe
 but why in my case, only the second legend is draggable? it is in the
 second axe

 besides, since I have to use both y-axis on the left and on the right,
 it seems I have to have two axes,
 are there any workarounds? thanks!

 On Wed, Mar 11, 2015 at 2:22 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 The mouse events only propagate to the top axes.  You will have to add
 both legends to the same (top) axes.

 See http://matplotlib.org/users/legend_guide.html#multiple-legend


 Tom
 On Wed, Mar 11, 2015, 08:57 liu lily politoeso...@gmail.com wrote:

 Hi, all:

 I have two legends, as below, I find that I can't drag the first
 legend, what is the problem? how to deal with it? thanks!

 import matplotlib.pyplot as plt

 fig1, ax1 = plt.subplots()
 ax2 = ax1.twinx()

 ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
 ax2.plot([1,2,3],[5,6,7],'ro', label=two)

 leg1 = ax1.legend()
 leg2 = ax2.legend()

 leg1.draggable(state=True)
 leg2.draggable(state=True)
 plt.show()

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join
 the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Lorenz -- another Q

2015-03-11 Thread Benjamin Root
What 3D array? There shouldn't be any 3D arrays. I suspect that x_t is only
accidentally 3d by having a shape like (N, M, 1) or (1, N, M).

Ben Root

On Wed, Mar 11, 2015 at 5:05 PM, Prahas David Nafissian 
prahas.mu...@gmail.com wrote:

 Hello,

 Solved the write issue.

 I tried numpy savetxt but it chokes on 3D arrays.

 So I'm doing this:

 x_t.tofile('test3.txt',sep= ,format=%f)

 Only issue -- no end-of-lines. But I can write a quick
 Pascal program to fix this...

 Once again, thanks!


 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Lorenz -- another Q

2015-03-11 Thread Prahas David Nafissian
Hello,

Solved the write issue.

I tried numpy savetxt but it chokes on 3D arrays.

So I'm doing this:

x_t.tofile('test3.txt',sep= ,format=%f)

Only issue -- no end-of-lines. But I can write a quick
Pascal program to fix this...

Once again, thanks!

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Lorenz -- another Q

2015-03-11 Thread Ryan Nelson
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 are libraries for these files on all OSs
using many programming languages. Python has at least two: PyTables and
h5py. I've personally used PyTables and find it very user-friendly. Pandas
also has capabilities for interacting with HDF files (via PyTables).

If you are only going to be using Numpy, there are also binary formats such
as .npy, .npz, and memmaps. See `numpy.save`, `numpy.savez`, and
`numpy.memmap`. I don't have much experience here, so I can't say much on
these formats...

Good luck.

Ryan

On Wed, Mar 11, 2015 at 5:15 PM, Benjamin Root ben.r...@ou.edu wrote:

 What 3D array? There shouldn't be any 3D arrays. I suspect that x_t is
 only accidentally 3d by having a shape like (N, M, 1) or (1, N, M).

 Ben Root

 On Wed, Mar 11, 2015 at 5:05 PM, Prahas David Nafissian 
 prahas.mu...@gmail.com wrote:

 Hello,

 Solved the write issue.

 I tried numpy savetxt but it chokes on 3D arrays.

 So I'm doing this:

 x_t.tofile('test3.txt',sep= ,format=%f)

 Only issue -- no end-of-lines. But I can write a quick
 Pascal program to fix this...

 Once again, thanks!


 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread liu lily
Hi, all:

I have two legends, as below, I find that I can't drag the first legend,
what is the problem? how to deal with it? thanks!

import matplotlib.pyplot as plt

fig1, ax1 = plt.subplots()
ax2 = ax1.twinx()

ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
ax2.plot([1,2,3],[5,6,7],'ro', label=two)

leg1 = ax1.legend()
leg2 = ax2.legend()

leg1.draggable(state=True)
leg2.draggable(state=True)
plt.show()
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread Thomas Caswell
The mouse events only propagate to the top axes.  You will have to add both
legends to the same (top) axes.

See http://matplotlib.org/users/legend_guide.html#multiple-legend


Tom
On Wed, Mar 11, 2015, 08:57 liu lily politoeso...@gmail.com wrote:

 Hi, all:

 I have two legends, as below, I find that I can't drag the first legend,
 what is the problem? how to deal with it? thanks!

 import matplotlib.pyplot as plt

 fig1, ax1 = plt.subplots()
 ax2 = ax1.twinx()

 ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
 ax2.plot([1,2,3],[5,6,7],'ro', label=two)

 leg1 = ax1.legend()
 leg2 = ax2.legend()

 leg1.draggable(state=True)
 leg2.draggable(state=True)
 plt.show()

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread liu lily
I dont understand
you say it is the first axe
but why in my case, only the second legend is draggable? it is in the
second axe

besides, since I have to use both y-axis on the left and on the right, it
seems I have to have two axes,
are there any workarounds? thanks!

On Wed, Mar 11, 2015 at 2:22 PM, Thomas Caswell tcasw...@gmail.com wrote:

 The mouse events only propagate to the top axes.  You will have to add
 both legends to the same (top) axes.

 See http://matplotlib.org/users/legend_guide.html#multiple-legend


 Tom
 On Wed, Mar 11, 2015, 08:57 liu lily politoeso...@gmail.com wrote:

 Hi, all:

 I have two legends, as below, I find that I can't drag the first legend,
 what is the problem? how to deal with it? thanks!

 import matplotlib.pyplot as plt

 fig1, ax1 = plt.subplots()
 ax2 = ax1.twinx()

 ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
 ax2.plot([1,2,3],[5,6,7],'ro', label=two)

 leg1 = ax1.legend()
 leg2 = ax2.legend()

 leg1.draggable(state=True)
 leg2.draggable(state=True)
 plt.show()

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Multiplot with one colorbar

2015-03-11 Thread Dyah rahayu martiningrum
Thank you so much Jody, Eric, Arnaldo, and Joy.
I will try your suggestion.


Dyah

On Sat, Mar 7, 2015 at 5:21 AM, Jody Klymak jkly...@uvic.ca wrote:

 Hi,

 I guess I don't understand the [axx for axx in ax.flat] command, but
 this steals from all the axes.

 Cheers,   Jody

 fig,ax = plt.subplots(2,2)
 for i in range(2):
 for j in range(2):
 im=ax[i,j].imshow(np.ones((20,20)))
 im.set_clim([-1.,2.])
 cax,kw = mpl.colorbar.make_axes([axx for axx in ax.flat],shrink=0.5)
 plt.colorbar(im, cax=cax, **kw)


  On Mar 6, 2015, at  9:39 AM, Eric Firing efir...@hawaii.edu wrote:
 
  On 2015/03/05 11:36 PM, Dyah rahayu martiningrum wrote:
  Hello all,
 
  I make multi plot with colorbars. I need help, how do make only one
  colorbar for six panels? I also want to show only lowest x-axis. I copy
  my recent code and  figure here.
 
  An old example of something like this is here:
 
  http://matplotlib.org/examples/pylab_examples/multi_image.html
 
  Eric
 
 
 --
  Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
  by Intel and developed in partnership with Slashdot Media, is your hub
 for all
  things parallel software development, from weekly thought leadership
 blogs to
  news, videos, case studies, tutorials and more. Take a look and join the
  conversation now. http://goparallel.sourceforge.net/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 

===
Dyah R Martiningrum
Student at Department of Communications and Computer Engineering
Graduate School of Informatics, Kyoto University
RISH, Gokasho, Uji shi, Kyoto, 611-0011, Japan.
Office : +81 0774 38 3856
Mobile : +81 090 6676 1981
===
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users