QWT plot with autoscaling shows negative values in y-axis



  • Hi,

    I have a QWT plot which shows only positive data values as a curve. I want autoscaling to be done since the values are not fixed in a range. But when autoscaling is enabled for y-left axis, then y-axis starts with negative values. how can i avoid this?

    setAxisAutoScale(QwtPlot::yLeft,true);

    I tried changing void QwtPlot::updateAxes() in my own class but facing issues because of d_axisData[axisId] private data.

    Thanks


  • Moderators

    @manikandan

    I would expect that there is some savety margin around the envelope defined through your data. Typically you do not want to see that your values are hitting the frame of your plot. Therefore, you need to have some room around your actual envelope. When you curves are actually starting at 0, this margin would require the axis to start in the negative range.

    Possibly the scale engine may help you in that respect, but I simply do not know.

    Note: QWT is not part of Qt but a third party library based on Qt. Typically there is little response here in the forum. The original author of QWT Uwe answered before some questions, but I have not noticed responses from him lately. Personally I would try on the qwt mailing list for such questions. There you have probably more chances.

    Hope this helps.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.