Quote Originally Posted by bigjoeystud View Post
I believe you have to override QwtScaleDraw with your own QwtScaleDraw::label routine. The label routine returns a QwtText which can have a color. Here's an example:

Qt Code:
  1. class ScaleDraw: public QwtScaleDraw
  2. {
  3. public:
  4. ScaleDraw ();
  5. virtual ~ScaleDraw () {};
  6.  
  7. virtual QwtText label (double value) const
  8. {
  9. QwtText ret_val = QwtText (QString::number (value));
  10. ret_val.setColor (_color);
  11. return ret_val;
  12. };
  13.  
  14. private:
  15. QColor _color;
  16. };
To copy to clipboard, switch view to plain text mode 

Joey
Hi again, I think I triyed that solution before with no result.

Y create a similar code
Qt Code:
  1. class NewDraw: public QwtScaleDraw
  2. {
  3. public:
  4. NewDraw(QColor c) {my_color = c;};
  5. virtual QwtText label (double value) const
  6. {
  7. QwtText ret_val = QwtText (QString::number (value));
  8. ret_val.setColor (my_color);
  9. return ret_val;
  10. };
  11.  
  12. private:
  13. QColor my_color;
  14. };
To copy to clipboard, switch view to plain text mode 

And when I want to chande de color:
Qt Code:
  1. QColor c = QColorDialog::getColor( Qt::white, this );
  2.  
  3. my_Plot->setAxisScaleDraw(QwtPlot::xBottom, new NewDraw(c));
To copy to clipboard, switch view to plain text mode 

But it doesnt work. Instead of changing the color of the numbers, all the numbers and ticks disappear. Any idea? Thanx