quiver without any scaling

Hi,

I woud like to draw a vector field using pylab.
quivert looks nice but it sould not scale the arrows to fit my use-case.
quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the arrow is not at (1.2,1.2).
Is there a way to plot a list of arrows *without* any scaling?

Xavier

Hi Xavier,

You can pass some handy keyword arguments to fix that. Use the following:

quiver([1],[1],[1.2],[1.2], angles='xy', scale_units='xy', scale=1)

Hope that helps :slight_smile:

Regards,
-- Damon

···

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 22 Nov 2009, at 16:37, Xavier Gnata wrote:

Hi,

I woud like to draw a vector field using pylab.
quivert looks nice but it sould not scale the arrows to fit my use-case.
quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the
arrow is not at (1.2,1.2).
Is there a way to plot a list of arrows *without* any scaling?

Xavier

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Hi,

RTFM...indeed it works.
However, the axis do not scale accordingly:

quiver([1],[1],[2],[2], angles='xy', scale_units='xy', scale=1) on a TkAgg backend produce a plot with:
In [11]: axis()
Out[11]:
(0.94000000000000006,
  1.0600000000000001,
  0.94000000000000006,
  1.0600000000000001)

The display area scales the same way as it does using quiver([1],[1],[2],[2]) (without any other args).
It looks like a bug.

Xavier

···

Hi Xavier,

You can pass some handy keyword arguments to fix that. Use the following:

quiver([1],[1],[1.2],[1.2], angles='xy', scale_units='xy', scale=1)

Hope that helps :slight_smile:

Regards,
-- Damon

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 22 Nov 2009, at 16:37, Xavier Gnata wrote:

Hi,

I woud like to draw a vector field using pylab.
quivert looks nice but it sould not scale the arrows to fit my use-case.
quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the
arrow is not at (1.2,1.2).
Is there a way to plot a list of arrows *without* any scaling?

Xavier

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
     

Hi Xavier (cc list),

It may be a bug, however I do not know what the default behaviour 'should' be. You could do:

lims = [-4, 4, -4, 4]
axis(lims)

after calling quiver to see the whole arrow. I did notice that calling

axis('tight')

threw the following error

/Users/Damon/python/lib/matplotlib/axes.py:2038: UserWarning: Attempting to set identical xmin==xmax results in singular transformations; automatically expanding. xmin=1.0, xmax=1.0
  warnings.warn('Attempting to set identical xmin==xmax results in singular transformations; automatically expanding. xmin=%s, xmax=%s'%(xmin, xmax))
/Users/Damon/python/lib/matplotlib/axes.py:2212: UserWarning: Attempting to set identical ymin==ymax results in singular transformations; automatically expanding. ymin=1.0, ymax=1.0
  warnings.warn('Attempting to set identical ymin==ymax results in singular transformations; automatically expanding. ymin=%s, ymax=%s'%(ymin, ymax))

is this correct, or is it a bug? I'm using "ipython -pylab" with the MacOSX backend. I was expecting axis('tight') would scale the axes so I could see the whole arrow.

Regards,
-- Damon

···

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 22 Nov 2009, at 21:34, Xavier Gnata wrote:

Hi,

RTFM...indeed it works.
However, the axis do not scale accordingly:

quiver([1],[1],[2],[2], angles='xy', scale_units='xy', scale=1) on a TkAgg backend produce a plot with:
In [11]: axis()
Out[11]:
(0.94000000000000006,
1.0600000000000001,
0.94000000000000006,
1.0600000000000001)

The display area scales the same way as it does using quiver([1],[1],[2],[2]) (without any other args).
It looks like a bug.

Xavier

Hi Xavier,

You can pass some handy keyword arguments to fix that. Use the following:

quiver([1],[1],[1.2],[1.2], angles='xy', scale_units='xy', scale=1)

Hope that helps :slight_smile:

Regards,
-- Damon

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 22 Nov 2009, at 16:37, Xavier Gnata wrote:

Hi,

I woud like to draw a vector field using pylab.
quivert looks nice but it sould not scale the arrows to fit my use-case.
quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the
arrow is not at (1.2,1.2).
Is there a way to plot a list of arrows *without* any scaling?

Xavier

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
    

Hi,

Well when you plot, imshow or whatever is matplotlib related, the axes do scale *automatically*.
Why should it be different with quiver?

I do reproduce your error with axis('tight')

Xavier

···

Hi Xavier (cc list),

It may be a bug, however I do not know what the default behaviour 'should' be. You could do:

lims = [-4, 4, -4, 4]
axis(lims)

after calling quiver to see the whole arrow. I did notice that calling

axis('tight')

threw the following error

/Users/Damon/python/lib/matplotlib/axes.py:2038: UserWarning: Attempting to set identical xmin==xmax results in singular transformations; automatically expanding. xmin=1.0, xmax=1.0
   warnings.warn('Attempting to set identical xmin==xmax results in singular transformations; automatically expanding. xmin=%s, xmax=%s'%(xmin, xmax))
/Users/Damon/python/lib/matplotlib/axes.py:2212: UserWarning: Attempting to set identical ymin==ymax results in singular transformations; automatically expanding. ymin=1.0, ymax=1.0
   warnings.warn('Attempting to set identical ymin==ymax results in singular transformations; automatically expanding. ymin=%s, ymax=%s'%(ymin, ymax))

is this correct, or is it a bug? I'm using "ipython -pylab" with the MacOSX backend. I was expecting axis('tight') would scale the axes so I could see the whole arrow.

Regards,
-- Damon

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 22 Nov 2009, at 21:34, Xavier Gnata wrote:

Hi,

RTFM...indeed it works.
However, the axis do not scale accordingly:

quiver([1],[1],[2],[2], angles='xy', scale_units='xy', scale=1) on a TkAgg backend produce a plot with:
In [11]: axis()
Out[11]:
(0.94000000000000006,
1.0600000000000001,
0.94000000000000006,
1.0600000000000001)

The display area scales the same way as it does using quiver([1],[1],[2],[2]) (without any other args).
It looks like a bug.

Xavier

Hi Xavier,

You can pass some handy keyword arguments to fix that. Use the following:

quiver([1],[1],[1.2],[1.2], angles='xy', scale_units='xy', scale=1)

Hope that helps :slight_smile:

Regards,
-- Damon

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 22 Nov 2009, at 16:37, Xavier Gnata wrote:

Hi,

I woud like to draw a vector field using pylab.
quivert looks nice but it sould not scale the arrows to fit my use-case.
quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the
arrow is not at (1.2,1.2).
Is there a way to plot a list of arrows *without* any scaling?

Xavier

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Hi Xavier,

I'm sorry. As I don't know a great deal about the nuts and bolts of matplotlib, I don't think I'm well enough equipped to answer your question. Perhaps someone else on this list can help out?

Regards,
-- Damon

···

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 23 Nov 2009, at 21:00, Xavier Gnata wrote:

Hi,

Well when you plot, imshow or whatever is matplotlib related, the axes do scale *automatically*.
Why should it be different with quiver?

I do reproduce your error with axis('tight')

Xavier

Hi Xavier (cc list),

It may be a bug, however I do not know what the default behaviour 'should' be. You could do:

lims = [-4, 4, -4, 4]
axis(lims)

after calling quiver to see the whole arrow. I did notice that calling

axis('tight')

threw the following error

/Users/Damon/python/lib/matplotlib/axes.py:2038: UserWarning: Attempting to set identical xmin==xmax results in singular transformations; automatically expanding. xmin=1.0, xmax=1.0
  warnings.warn('Attempting to set identical xmin==xmax results in singular transformations; automatically expanding. xmin=%s, xmax=%s'%(xmin, xmax))
/Users/Damon/python/lib/matplotlib/axes.py:2212: UserWarning: Attempting to set identical ymin==ymax results in singular transformations; automatically expanding. ymin=1.0, ymax=1.0
  warnings.warn('Attempting to set identical ymin==ymax results in singular transformations; automatically expanding. ymin=%s, ymax=%s'%(ymin, ymax))

is this correct, or is it a bug? I'm using "ipython -pylab" with the MacOSX backend. I was expecting axis('tight') would scale the axes so I could see the whole arrow.

Regards,
-- Damon

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 22 Nov 2009, at 21:34, Xavier Gnata wrote:

Hi,

RTFM...indeed it works.
However, the axis do not scale accordingly:

quiver([1],[1],[2],[2], angles='xy', scale_units='xy', scale=1) on a TkAgg backend produce a plot with:
In [11]: axis()
Out[11]:
(0.94000000000000006,
1.0600000000000001,
0.94000000000000006,
1.0600000000000001)

The display area scales the same way as it does using quiver([1],[1],[2],[2]) (without any other args).
It looks like a bug.

Xavier

Hi Xavier,

You can pass some handy keyword arguments to fix that. Use the following:

quiver([1],[1],[1.2],[1.2], angles='xy', scale_units='xy', scale=1)

Hope that helps :slight_smile:

Regards,
-- Damon

--------------------------
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdougall@...831...

On 22 Nov 2009, at 16:37, Xavier Gnata wrote:

Hi,

I woud like to draw a vector field using pylab.
quivert looks nice but it sould not scale the arrows to fit my use-case.
quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the
arrow is not at (1.2,1.2).
Is there a way to plot a list of arrows *without* any scaling?

Xavier

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options