The next build of Androidplot will contain a new class and a couple new methods that can be used to accomplish this. For now, here's a development build that contains this new functionality. The new class is com.androidplot.util.Mapping and the new methods of interested will be added to com.androidplot.xy.XYGraphWidget. They are:
public void setDomainLabelPaintMap(Mapping<Paint, Number> domainLabelPaintMap)
public void setRangeLabelPaintMap(Mapping<Paint, Number> rangeLabelPaintMap)
Here's a quick example of how they can be used:
plot.getGraphWidget().setRangeLabelPaintMap(new Mapping<Paint, Number>() {
private Paint customPaint;
{
// configure Paint instances either programmatically
// (as shown here) or use Configurator to initialize via XML.
customPaint = new Paint();
customPaint.setColor(Color.RED);
}
@Override
public Paint get(Number number) {
if(number.doubleValue() > 1) {
return customPaint;
}
return null;
}
});