summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/TimeDomainDisplayPlot.cc
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-02-17 18:26:09 -0500
committerTom Rondeau <trondeau@vt.edu>2013-02-17 18:33:51 -0500
commit4aaa4f0cb076e2ad78a28eaba101182cbd868ba2 (patch)
treed2d421ca6ce91601cf2f10095ef629211d342b97 /gr-qtgui/lib/TimeDomainDisplayPlot.cc
parent60f6b22a5f11d5c54771dc5a9b4567ba35852088 (diff)
qtgui: improved handling of GUI events and log-y scale.
Diffstat (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.cc')
-rw-r--r--gr-qtgui/lib/TimeDomainDisplayPlot.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index d319c58a27..032da2547d 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -279,8 +279,20 @@ TimeDomainDisplayPlot::_resetXAxisPoints()
void
TimeDomainDisplayPlot::_autoScale(double bottom, double top)
{
- // Auto scale the y-axis with a margin of 20%
- setYaxis(bottom - fabs(bottom)*0.20, top + fabs(top)*0.20);
+ // Auto scale the y-axis with a margin of 20% (10 dB for log scale)
+ double _bot = bottom - fabs(bottom)*0.20;
+ double _top = top + fabs(top)*0.20;
+ if(d_semilogy) {
+ if(bottom > 0) {
+ setYaxis(_bot-10, _top+10);
+ }
+ else {
+ setYaxis(1e-3, _top+10);
+ }
+ }
+ else {
+ setYaxis(_bot, _top);
+ }
}
void