Re: [Matplotlib-users] a quick way to plot 3D surface with point coordination?

2010-03-31 Thread Alan G Isaac
On 3/31/2010 10:40 PM, ericyosho wrote:
> send x and y ranges to meshgrid
>

Does this mean you have the entire grid of points?
In any case, you can get an array of your points
as np.array([(x,y,z) for (x,y),z in d.iteritems()])

fwiw,
Alan Isaac


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] bus error on os x 10.6

2010-03-31 Thread Gideon Simpson
I'm using the prebuilt OS X dmg distribution of matplotlib with the mac python 
2.6.4 installation on os x 10.6.3.  I find that if I try to use savefig to pdf 
format, my program terminates with a bus error.  There is no such error if I 
save to eps format.

-gideon


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] a quick way to plot 3D surface with point coordination?

2010-03-31 Thread ericyosho
Hi, All,

I have a bunch of 3D points with coordinations in a dict
pointset = {
(x1,y1):z1,
(x2,y2):z2,
...
}

It seems I have to
1. fire a loop to change each item and convert the whole dictionary into arrays;
x = []
y = []
for i in pointset.items():
x.append(i[0][0])
y.append(i[0][1])

2. send x and y ranges to meshgrid
3. loop again to put z values into proper positions
4. use plot_surface()

Is there any quicker ways to do that?

And we know that for points with coordination, scatter must be the
simplest way to visualize them.
Is there any trick to convert a scatter graph into a surface picture directly?

Appreciation for any ideas.


Zhe Yao
--
Department of Computer and Electrical Engineering
McGill University
Montreal, QC, Canada
H3A 2A7

zhe@mail.mcgill.ca

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to show separate legend for each subplot

2010-03-31 Thread Ryan May
On Wed, Mar 31, 2010 at 10:21 AM, Omer Khalid  wrote:
> Hi Paul,
> Thanks for your prompt response. It did help :)
> But it seems that axis don't seems to accept title, xlable and ylable values
> any more. Any ideas on that?

If you're trying to use the functions plt.title() and plt.xlabel(),
they only work on the current axes object (basically, the most
recently created one).  You'll want to try to use methods on the axes
themselves:

ax1.set_title('ax1 title')
ax1.set_xlabel('xlabel')

ax2.set_title('ax2 title')
ax2.set_xlabel('xlabel')

Ryan

> On Wed, Mar 31, 2010 at 17:43,  wrote:
>>
>> From: Omer Khalid [mailto:omer.kha...@cern.ch]
>> Sent: Wednesday, March 31, 2010 6:20 AM
>> To: Matplotlib Users
>> Subject: [Matplotlib-users] How to show separate legend for each subplot
>>
>> Hi,
>>
>> I am wondering is there a way one could show a separate legend for each
>> subplot in a figure? I would really really appreciate any ideas on this.
>> `~'
>>
>> Omer,
>>
>> Give this a shot:
>> # code ->
>> import matplotlib.pyplot as pl
>> fig = pl.figure()
>> ax1 = fig.add_subplot(1,2,1)
>> ax2 = fig.add_subplot(1,2,2)
>>
>> ax1.plot([1,2], [3,4], 'ko', label='First Axes')
>> ax2.plot([2,3], [4,5[, 'bs', label='Second Axes')
>>
>> ax1.legend()
>> ax2.legend()
>> # <- code
>>
>> There's also an example in the Examples section of the MPL website:
>>
>> http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html
>>
>> Hope that helps,
>> -paul
>
>
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>




-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to show separate legend for each subplot

2010-03-31 Thread Omer Khalid
Hi Paul,

Thanks for your prompt response. It did help :)

But it seems that axis don't seems to accept title, xlable and ylable values
any more. Any ideas on that?

Cheers
Omer

On Wed, Mar 31, 2010 at 17:43,  wrote:

> From: Omer Khalid [mailto:omer.kha...@cern.ch]
> Sent: Wednesday, March 31, 2010 6:20 AM
> To: Matplotlib Users
> Subject: [Matplotlib-users] How to show separate legend for each subplot
>
> Hi,
>
> I am wondering is there a way one could show a separate legend for each
> subplot in a figure? I would really really appreciate any ideas on this.
> `~'
>
> Omer,
>
> Give this a shot:
> # code ->
> import matplotlib.pyplot as pl
> fig = pl.figure()
> ax1 = fig.add_subplot(1,2,1)
> ax2 = fig.add_subplot(1,2,2)
>
> ax1.plot([1,2], [3,4], 'ko', label='First Axes')
> ax2.plot([2,3], [4,5[, 'bs', label='Second Axes')
>
> ax1.legend()
> ax2.legend()
> # <- code
>
> There's also an example in the Examples section of the MPL website:
> http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html
>
> Hope that helps,
> -paul
>
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to show last value on the line

2010-03-31 Thread PHobson
From: Omer Khalid [mailto:omer.kha...@cern.ch] 
Sent: Wednesday, March 31, 2010 6:14 AM
To: Matplotlib Users
Subject: [Matplotlib-users] How to show last value on the line

Hi, 

I have produced number of charts in my research thesis. On any given chart, 
there are number of lines. I would like to display the last value on each line 
to show at which precise value it's ending.

Thanks,
Omer


Omer, 
Give something like this a shot:
http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo.html

Remember that in python you can easily access the last element of an array (x) 
with x[-1].
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to show separate legend for each subplot

2010-03-31 Thread PHobson
From: Omer Khalid [mailto:omer.kha...@cern.ch] 
Sent: Wednesday, March 31, 2010 6:20 AM
To: Matplotlib Users
Subject: [Matplotlib-users] How to show separate legend for each subplot

Hi, 

I am wondering is there a way one could show a separate legend for each subplot 
in a figure? I would really really appreciate any ideas on this.
`~'

Omer,

Give this a shot:
# code ->
import matplotlib.pyplot as pl
fig = pl.figure()
ax1 = fig.add_subplot(1,2,1)
ax2 = fig.add_subplot(1,2,2)

ax1.plot([1,2], [3,4], 'ko', label='First Axes')
ax2.plot([2,3], [4,5[, 'bs', label='Second Axes')

ax1.legend()
ax2.legend()
# <- code

There's also an example in the Examples section of the MPL website:
http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html

Hope that helps,
-paul
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to show separate legend for each subplot

2010-03-31 Thread Omer Khalid
Hi,

I am wondering is there a way one could show a separate legend for each
subplot in a figure? I would really really appreciate any ideas on this.

Thanks,
Omer
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to show last value on the line

2010-03-31 Thread Omer Khalid
Hi,

I have produced number of charts in my research thesis. On any given chart,
there are number of lines. I would like to display the last value on each
line to show at which precise value it's ending.

Thanks,
Omer
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] permille sign in labels

2010-03-31 Thread Nils Wagner
On Wed, 24 Mar 2010 10:14:29 -0400
  Michael Droettboom  wrote:
> You can use Unicode.
> 
>  ylabel(u'\u2030')
> 
> http://www.unicode.org/charts/charindex.html
> 
> Mike
  

Degree Celsius u'\u2103' doesn't work.

/usr/local/lib64/python2.4/site.packages/matplotlib/mathtext.py:722: 
MathTextWarning: Unrecognized symbol '\u2103'.
Substituting with a dummy symbol.

How can I resolve the problem ?

Nils

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to save file in to image in desired resolution in matplotlib?

2010-03-31 Thread Matthias Michler
On Wednesday 31 March 2010 09:24:10 yogesh karpate wrote:
> Dear All,
>I am using one image of 235X130 and plotting the curve on
> it, now when i save it it goes  in the resoltuion  of 800X600,
> I want to keep the resolution intact.What can be done for that to keep the
> resolution same?
> I am using
> savefig('/home/jaguar/Softwares/Development/Python/bunty.png')
> Thanks in advance!
> Regards
> Yogesh

Hi Yogesh,

You can adjust the resolution by changing the figure size and the dpi in 
savefig.

Keyword of figure:
 *figsize* width x height in inches; defaults to rc figure.figsize

Keyword of savefig:
  *dpi*: [ None | scalar > 0 ]
The resolution in dots per inch.  If *None* it will default to
the value ``savefig.dpi`` in the matplotlibrc file.

e.g.
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt

# aim: 235X130
fig = plt.figure(figsize=(23.5, 13.0))
ax = plt.axes([0.0, 0.0, 1.0, 1.0])
ax.plot([1, 2, 4], lw=5)
ax.set_xticks([])
ax.set_yticks([])

fig.savefig('test.png', dpi=10)

Kind regards,
Matthias

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to save file in to image in desired resolution in matplotlib?

2010-03-31 Thread yogesh karpate
Dear All,
   I am using one image of 235X130 and plotting the curve on it,
now when i save it it goes  in the resoltuion  of 800X600,
I want to keep the resolution intact.What can be done for that to keep the
resolution same?
I am using
savefig('/home/jaguar/Softwares/Development/Python/bunty.png')
Thanks in advance!
Regards
Yogesh
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users