Number of major ticks strategy
Brought to you by:
rathmann
|
From: Murphy, S. <sm...@wa...> - 2019-05-03 17:06:03
|
I'm having an issue where when I first setup a plot, the left & right scale widgets are set up pretty nicely - they have a reasonable number of major tick marks. But I allow the user to resize the plot vertically. Growing the plot isn't really a problem, but when the user shrinks the plot I think I need to reduce the number of major tick marks just to keep them from getting to crammed in on each other. I was just wondering if anyone has already come up with a strategy for handling this (or if I'm just missing something in the API that already does this)? My thought was overriding resizeEvent() and then based on the new size, dynamically call "something" - not sure which function is best to call here, maybe just call QwtPlot::setAxisScale() again with the same values as before to get the updateAxes() to recalculate the scale for me? My requirements are: - Linear scale - I need to specify the min/max values of the scale AND see those exact values on the top & bottom of the scale widget. So if for example, I set the range from 17 to 43, the label for the bottommost tick mark needs to say 17, and the label for the topmost needs to say 43. Similarly if I set it from -20 to 100, I need to see -20 and 100 at the two ends of the scale. - I don't particularly care whether the tickmarks in between the min & max are based on multiples of 2,5, or 10 based, or if they are based on some other multiple - Need to be able to dynamically decrease/increase number of tick marks as the height of the plot changes with the goal being a "decent" amount of pixel space between major ticks, even if that means we drop down to only 2 major tick marks for the entire scale - the min & the max values, I always need to see those two. Sean Murphy Sr. Project Engineer Walbro LLC 4144 Doerr Rd Cass City, MI 48726 ph. 989 872 7274 cell 734 223 8975 fax. 989 872 3782 sm...@wa...<mailto:sm...@wa...> Confidentiality Notice: The materials contained within this e-mail transmission (including all attachments) are private and confidential and the property of the sender. The information contained in the materials is privileged and intended only for the named addressee(s). If you are not the intended addressee, be advised that any unauthorized disclosure, copying, distribution or the taking of any action in reliance on the contents of this material is strictly prohibited. If you have received this e-mail transmission in error, please immediately notify the sender by telephone at 989-872-7274 or send an e-mail to sm...@wa...<mailto:sm...@wa...> and thereafter destroy the e-mail you received and all copies thereof. This message has been scanned for malware by Forcepoint. www.forcepoint.com |