Maybe I'm just not seeing it; I don't see how the definition on wikipedia,
your definition, and matplotlib behavior differ.

import numpy as np
import matplotlib
matplotlib.use('WxAgg')
import matplotlib.pyplot as plt

t = np.linspace(0.0,2.0*np.pi, 50)
r = np.linspace(0.0,2.0*np.pi, 50)

plt.polar(t,r,color='blue')
plt.polar(t,-r,color='red')
plt.polar(-t,r,color='green')
plt.polar(-t,-r,color='yellow')
plt.show()

Comparing blue and red, you can see how mpl handles a negative r; each
point is 'opposite' just as described.
Comparing blue and green, you can see how mpl handles a negative angle.
 green curve increases in as you go clockwise, which is correct.




On Mon, Dec 17, 2012 at 6:54 PM, Andre' Walker-Loud <walksl...@gmail.com>wrote:

> >
> http://en.wikipedia.org/wiki/Polar_coordinate_system#Uniqueness_of_polar_coordinates
>
> quoting from the site
>
> '''
> Where a unique representation is needed for any point, it is usual to
> limit r to non-negative numbers (r ≥ 0) and θ to the interval [0, 360°) or
> (−180°, 180°] (in radians, [0, 2π) or (−π, π]).[12] One must also choose a
> unique azimuth for the pole, e.g., θ = 0.
> '''
>
> Of course I don't have anything close to a scientific study of the
> following statement, but I suspect in practice (ie as polar coordinates are
> used in practice by working scientists), they expect to find values of "r"
> consistent with the above definition of unique - however, still wanting
> theta to not be bounded.
>
> Taking another quote form the site
>
> '''
> Also, a negative radial coordinate is best interpreted as the
> corresponding positive distance measured in the opposite direction.
> '''
>
> How does one define opposite in polar coordinates?  The natural definition
> for "opposite" direction is presumably theta --> theta + pi, as that
> definition would correspond to the same notion of "opposite" in Cartesian
> coordinates (take whatever direction you were drawing a line, and go in "-"
> that direction.  If we agree that this is the sensible definition of
> opposite, then pyplot.polar is not representing this definition of opposite.
>
> Attached are two plots.  The first uses
>
> ''' as matplotlib is - neg_r.png '''
> import numpy as np
> import matplotlib.pyplot as plt
>
> t = np.linspace(-np.pi, np.pi, 60)
> r = t
> plt.polar(t,r)
>
> The second produces a curve which I say represents the natural definition
> of "opposite".  Note, the tangents of the curves are also opposite as well
>
> ''' as matplotlib "should be" - neg_r_opposite.png '''
> import numpy as np
> import matplotlib.pyplot as plt
>
> t = np.linspace(0, np.pi, 30)
> r = t
> plt.polar(t,r)
> t_opp = np.linspace(np.pi,2*np.pi,30)
> r_opp = t_opp - np.pi
> plt.polar(t_opp,r_opp)
>
>
> I have three points to make with these plots:
> 1) my definition of opposite makes more sense than the default behavior of
> matplotlib
> 2) other people may have different ideas about what is best
> 3) matplotlib should at least raise a NOISY warning about what it is doing.
>
>
> Andre
>
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>


-- 
Daniel Hyams
dhy...@gmail.com
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to