Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 79

2010-07-31 Thread Friedrich Romstedt
2010/7/29 Waléria Antunes David waleriantu...@gmail.com:
 Hi Benjamim,

 I made the changes as bellow and it displays the x-axis values formatted as
 expected, see my current image and my code. But, now i need to change the
 scale and the numbers of decimal places in order to appear on the graph like
 this: 3.0 3.1  3.2  ..   3.4

I think you need:

import matplotlib.ticker
[...]
axes.xaxis.set_major_locator(matplotlib.ticker.MaxNLocator(nbins=4)

maybe with an additional argument steps=[1, 2, 5, 10] as done by AutoLocator.

Your pastebin code has expired, so I don't know how your variables are
named now.

Friedrich

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 79

2010-07-29 Thread ms
On 29/07/10 12:45, Waléria Antunes David wrote:
 Hi Benjamim,

 I made the changes as bellow and it displays the x-axis values formatted as
 expected, see my current image and my code. But, now i need to change the
 scale and the numbers of decimal places in order to appear on the graph like
 this: 3.0 3.1  3.2  ..   3.4

 My code: http://pastebin.com/vSbkXDzE

 Can you help me?

 Waleria


What do you mean by change the scale?

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 79

2010-07-29 Thread Waléria Antunes David
On Thu, Jul 29, 2010 at 8:45 AM, Waléria Antunes David 
waleriantu...@gmail.com wrote:

 Hi

 I made the changes as bellow and it displays the x-axis values formatted as
 expected, see my current image and my code. But, now i need to change the
 scale and the numbers of decimal places in order to appear on the graph like
 this: 3.0 3.1  3.2  ..   3.4

 My code: http://pastebin.com/vSbkXDzE

 Can you help me?

 Waleria


 On Wed, Jul 28, 2010 at 8:41 PM, 
 matplotlib-users-requ...@lists.sourceforge.net wrote:

 Send Matplotlib-users mailing list submissions to
matplotlib-users@lists.sourceforge.net

 To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 or, via email, send a message with subject or body 'help' to
matplotlib-users-requ...@lists.sourceforge.net

 You can reach the person managing the list at
matplotlib-users-ow...@lists.sourceforge.net

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Matplotlib-users digest...


 Today's Topics:

   1. Re: hz to khz (Angus McMorland)
   2. Re: hz to khz (Benjamin Root)
   3. Arrow in log space (Thomas Robitaille)
   4. Re: Arrow in log space (Benjamin Root)
   5. Re: Confusion Matrix (Simon Friedberger)
   6. Re: Saving as eps file shifts image? (Jae-Joon Lee)


 --

 Message: 1
 Date: Wed, 28 Jul 2010 15:39:29 -0400
 From: Angus McMorland amcm...@gmail.com
 Subject: Re: [Matplotlib-users] hz to khz
 To: Matplotlib Users matplotlib-users@lists.sourceforge.net
 Message-ID:

 aanlktinomazdzccuukenq+c99y+0ewc_o7o+6jpzq...@mail.gmail.comaanlktinomazdzccuukenq%2bc99y%2b0ewc_o7o%2b6jpzq...@mail.gmail.com
 
 Content-Type: text/plain; charset=ISO-8859-1

 On 28 July 2010 15:25, Wal?ria Antunes David waleriantu...@gmail.com
 wrote:
  Hello all,
 
  Well, my problem is ... My current code is as follow bellow:
  http://pastebin.com/7p2N5d64

 Hi Wal?ria,

 We can't easily fix your problem without knowing what data f and
 Sserie contain. It would help us to help you if you could post a
 standalone example that shows your problem without relying on external
 data.

 Angus.
 --
 AJC McMorland
 Post-doctoral research fellow
 Neurobiology, University of Pittsburgh



 --

 Message: 2
 Date: Wed, 28 Jul 2010 14:59:35 -0500
 From: Benjamin Root ben.r...@ou.edu
 Subject: Re: [Matplotlib-users] hz to khz
 To: Angus McMorland amcm...@gmail.com
 Cc: Matplotlib Users matplotlib-users@lists.sourceforge.net
 Message-ID:
aanlkti=o73e3atkqprzo5_lmpfou=72cnvjbltsnn...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 On Wed, Jul 28, 2010 at 2:39 PM, Angus McMorland amcm...@gmail.com
 wrote:

  On 28 July 2010 15:25, Wal?ria Antunes David waleriantu...@gmail.com
  wrote:
   Hello all,
  
   Well, my problem is ... My current code is as follow bellow:
   http://pastebin.com/7p2N5d64
 
  Hi Wal?ria,
 
  We can't easily fix your problem without knowing what data f and
  Sserie contain. It would help us to help you if you could post a
  standalone example that shows your problem without relying on external
  data.
 
  Angus.
  --
  AJC McMorland
  Post-doctoral research fellow
  Neurobiology, University of Pittsburgh
 
 
 Angus is correct that providing a stand-alone version of the script that
 replicates your problem would be most useful.  I would like to mention a
 couple of possible improvements to your code.  These improvements may or
 may
 not fix your issue, but they will improve your current code.

 1) Use list comprehensions

 Change

 y=[]
 for n in f:
y.append(n/Decimal(1000))
 y = numpy.array(y)

 into:

 y = numpy.array(f) / 1000.0

 Also,

 ax.grid('TRUE')

 should be:

  ax.grid(True)

 I hope this helps.  If not, then please send a stand-alone example that
 duplicates the problem you are having.
 Ben Root
 -- next part --
 An HTML attachment was scrubbed...

 --

 Message: 3
 Date: Wed, 28 Jul 2010 16:56:41 -0400
 From: Thomas Robitaille thomas.robitai...@gmail.com
 Subject: [Matplotlib-users] Arrow in log space
 To: matplotlib-users@lists.sourceforge.net
 Message-ID: fc45934c-52aa-4b5d-91b1-d155e7e75...@gmail.com
 Content-Type: text/plain; charset=us-ascii

 Hi,

 How does one plot an arrow in a log log plot? In the following example, I
 can't get the arrow head, regardless of what value I use for the head width:

 import matplotlib as mpl
 mpl.use('Agg')
 import matplotlib.pyplot as plt

 fig = plt.figure()
 ax = fig.add_subplot(1,1,1)
 ax.arrow(0.2,0.2,0.5,0.5,head_width=1.)
 ax.set_xscale('log')
 ax.set_yscale('log')
 ax.set_xlim(0.1,1.)
 ax.set_ylim(0.1,1.)
 fig.savefig('test.png')

 In addition, the documentation for arrow does not even mention any arrow
 specific options such as the head width/length, and the example plot is