In PolarAxes.set_rgrids(), remove the test for rmin <= 0.
Explanation: while it is possible to plot negative values in a polar plot (e.g. antenna gain down to -30 dB, as a function of azimuth), placing radial grids at negative values is rejected, for no apparent reason.
I would argue that if there is a 'natural' way to deal with negative radius values, it should be via reflection as discussed in the other issue. I don't know what the best solution it is not obvious. @dmcdougall you have thoughts?
Why not something along these lines. Reflect any data that falls below
rmin instead of automatically reflecting only those values less than zero?
Or would it make more sense that it should clip those values?
Personally I have little use for reflected values at all, but it may be counter intuitive to some. For me, I'd advocate clipping data that falls below rmin (just like we would clip data that falls below ymin).
I see polar plots as essentially a Cartesian plot which has been mapped into a circle, or even more preferably an annulus (however I don't see how to create a polar plot in the shape of an annulus here).
I agree - clipping (i.e. if y<rmin, then set y=rmin) is the most
appropriate. For engineering plots of dB vs angle, large negative values
mean negligible signal levels, so it's OK if they all map to the origin of
the polar plot. This gives nice looking plots, as you would want.
Personally I have little use for reflected values at all, but it may be
counter intuitive to some. For me, I'd advocate clipping data that falls
below rmin (just like we would clip data that falls below ymin).
I see polar plots as essentially a Cartesian plot which has been mapped
into a circle, or even more preferably an annulus (however I don't see how
to create a polar plot in the shape of an annulus here).
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2203#issuecomment-20625987
.
Dan Timson
System Architect
CRFS Ltd
Building 7200
Cambridge Research Park
Beach Drive
Cambridge
CB25 9TL
@mdboom We are suggesting that in certain fields it is often useful for rmin to be negative.
One way to think about this is that for plotting things are drawn in the physical location (theta, r - rmin) but labeled as r. For example, this plot would have rmin = -15 and rmax = 0.
@dtimsonhttps://github.com/dtimson I don't understand what you mean.
The reason we clip r<=0 is that it negative r values were turning into
effective rotations by pi.
This is not a bit of the code base I am familiar with nor use on a regular
basis, could you put together a PR showing what you are suggesting?
—
Reply to this email directly or view it on GitHub #2203 (comment)
.
Dan Timson
System Architect
CRFS Ltd
Building 7200
Cambridge Research Park
Beach Drive
Cambridge
CB25 9TL
The issue was that we have two competing feature requests here.
Treat the radial as a regular cartesian number line that is just simply
anchored at whatever the minimum r value is (thus allowing negative values
in situations such as log scale).
Treat the negative radials as a rotation by pi.
The original behavior way back when did neither of these, IIRC.
Unfortunately, I don't see how we can implement both as they seem to be
mutually exclusive. I am not sure how to proceed. Perhaps we can get some
inspirations from other projects such as Matlab, R's ggplot, and mathmatica?
@dtimsonhttps://github.com/dtimson I don't understand what you mean.
The reason we clip r<=0 is that it negative r values were turning into
effective rotations by pi.
This is not a bit of the code base I am familiar with nor use on a
regular
basis, could you put together a PR showing what you are suggesting?
Is there anyone who actually wants option 2, treating negative radials as a
rotation by pi? If not, let's just go with option 1. allowing negative
values. The option 2 behaviour would in any case be easily achievable by
minor processing of the input data.
The issue was that we have two competing feature requests here.
Treat the radial as a regular cartesian number line that is just simply
anchored at whatever the minimum r value is (thus allowing negative values
in situations such as log scale).
Treat the negative radials as a rotation by pi.
The original behavior way back when did neither of these, IIRC.
Unfortunately, I don't see how we can implement both as they seem to be
mutually exclusive. I am not sure how to proceed. Perhaps we can get some
inspirations from other projects such as Matlab, R's ggplot, and
mathmatica?
@dtimsonhttps://github.com/dtimson I don't understand what you
mean.
The reason we clip r<=0 is that it negative r values were turning into
effective rotations by pi.
This is not a bit of the code base I am familiar with nor use on a
regular
basis, could you put together a PR showing what you are suggesting?
—
Reply to this email directly or view it on GitHub
<
Is it possible to have a rminclip={True, False, 'auto'} parameter and support both? If you set the rmin=0 and have clip=False, it goes through the origin and produces an effective rotation by pi. If you have the rmin=-100, and clip=True, then it shows negative dB until they hit -100 and then clips them so they don't go through the origin. 'auto' would be False if rmin == 0 and True otherwise?
@dtimson to answer your question: I, for one, was expecting that negative radial values be plotted as rotations by pi. When using radial plots to show vectors, it is standard that a negative magnitude be shown as a positive vector in the opposite direction.
Activity
tacaswell commented on Jul 7, 2013
related to issue #2133
bfroehle commented on Jul 8, 2013
I just came across this issue. I've been using a workaround in the mean time.
dtimson commented on Jul 8, 2013
It's natural to want to plot this:
It's an antenna gain pattern, plotting gain in dB, going down to -25dB in
value at the two nulls. Gridlines are at -10, -20, -30.
This was plotted just by removing the test for rmin <= 0 in
PolarAxes.set_rgrids(), in polar.py
On 7 July 2013 16:53, Thomas A Caswell notifications@github.com wrote:
Dan Timson
System Architect
CRFS Ltd
Building 7200
Cambridge Research Park
Beach Drive
Cambridge
CB25 9TL
Tel: +44 (0)1223 815615
Direct: +44 (0)1223 815522
e: dtimson@crfs.com
w: www.crfs.com
tacaswell commented on Jul 8, 2013
I would argue that if there is a 'natural' way to deal with negative radius values, it should be via reflection as discussed in the other issue. I don't know what the best solution it is not obvious. @dmcdougall you have thoughts?
WeatherGod commented on Jul 8, 2013
Why not something along these lines. Reflect any data that falls below
rmin instead of automatically reflecting only those values less than zero?
Or would it make more sense that it should clip those values?
bfroehle commented on Jul 8, 2013
Personally I have little use for reflected values at all, but it may be counter intuitive to some. For me, I'd advocate clipping data that falls below rmin (just like we would clip data that falls below ymin).
I see polar plots as essentially a Cartesian plot which has been mapped into a circle, or even more preferably an annulus (however I don't see how to create a polar plot in the shape of an annulus here).
dtimson commented on Jul 8, 2013
I agree - clipping (i.e. if y<rmin, then set y=rmin) is the most
appropriate. For engineering plots of dB vs angle, large negative values
mean negligible signal levels, so it's OK if they all map to the origin of
the polar plot. This gives nice looking plots, as you would want.
On 8 July 2013 19:29, Bradley M. Froehle notifications@github.com wrote:
Dan Timson
System Architect
CRFS Ltd
Building 7200
Cambridge Research Park
Beach Drive
Cambridge
CB25 9TL
Tel: +44 (0)1223 815615
Direct: +44 (0)1223 815522
e: dtimson@crfs.com
w: www.crfs.com
mdboom commented on Jul 16, 2013
So, the current behavior (in 1.2.1 and 1.3.0) is to clip values < rmin. If so, what is the value of plotting gridlines at negative values?
bfroehle commented on Jul 16, 2013
@mdboom We are suggesting that in certain fields it is often useful for rmin to be negative.
One way to think about this is that for plotting things are drawn in the physical location (theta, r - rmin) but labeled as r. For example, this plot would have rmin = -15 and rmax = 0.
tacaswell commented on Jun 29, 2014
MEP: https://github.com/matplotlib/matplotlib/wiki/MEP24
@bfroehle @dtimson I have created a MEP to deal with this and would like both of your inputs.
It is highly unlikely this will get done for 1.4.0, punting to 1.5.x.
3 remaining items
dtimson commented on Jul 18, 2014
OK, if you've got people putting in radial coords with negative radii (!),
it would be shame to break their code. So use clipping if you like.
Dan
On 18 July 2014 13:13, Thomas A Caswell notifications@github.com wrote:
Dan Timson
System Architect
CRFS Ltd
Building 7200
Cambridge Research Park
Beach Drive
Cambridge
CB25 9TL
Tel: +44 (0)1223 815615
Direct: +44 (0)1223 815522
e: dtimson@crfs.com
w: www.crfs.com
WeatherGod commented on Jul 18, 2014
The issue was that we have two competing feature requests here.
anchored at whatever the minimum r value is (thus allowing negative values
in situations such as log scale).
The original behavior way back when did neither of these, IIRC.
Unfortunately, I don't see how we can implement both as they seem to be
mutually exclusive. I am not sure how to proceed. Perhaps we can get some
inspirations from other projects such as Matlab, R's ggplot, and mathmatica?
Cheers!
Ben Root
On Fri, Jul 18, 2014 at 9:13 AM, dtimson notifications@github.com wrote:
dtimson commented on Jul 18, 2014
Is there anyone who actually wants option 2, treating negative radials as a
rotation by pi? If not, let's just go with option 1. allowing negative
values. The option 2 behaviour would in any case be easily achievable by
minor processing of the input data.
Dan
On 18 July 2014 15:01, Benjamin Root notifications@github.com wrote:
Dan Timson
System Architect
CRFS Ltd
Building 7200
Cambridge Research Park
Beach Drive
Cambridge
CB25 9TL
Tel: +44 (0)1223 815615
Direct: +44 (0)1223 815522
e: dtimson@crfs.com
w: www.crfs.com
endolith commented on Jul 18, 2014
Is it possible to have a rminclip={True, False, 'auto'} parameter and support both? If you set the rmin=0 and have clip=False, it goes through the origin and produces an effective rotation by pi. If you have the rmin=-100, and clip=True, then it shows negative dB until they hit -100 and then clips them so they don't go through the origin. 'auto' would be False if rmin == 0 and True otherwise?
In dB polar plots, negative and positive radii produce the same magnitude decibel value, so you sometimes see them show polarity as different colors: http://www.sweetwater.com/insync/media/2013/05/supercardioid.gif
Isn't that necessary to make things like http://mathworld.wolfram.com/Rose.html ?
gabrielgrant commented on Sep 12, 2014
@dtimson to answer your question: I, for one, was expecting that negative radial values be plotted as rotations by pi. When using radial plots to show vectors, it is standard that a negative magnitude be shown as a positive vector in the opposite direction.
dstansby commented on Nov 12, 2017
I think this is now fixed by #4699 @QuLogic ?
QuLogic commented on Nov 12, 2017
Yes, dunno why it wasn't tagged before.