[python] Add an "axis" function to the matplotlib module

This commit is contained in:
Romain Goyet
2020-03-11 10:01:49 -04:00
committed by Émilie Feral
parent c99bed6922
commit 6a796f5f7c
10 changed files with 183 additions and 27 deletions

View File

@@ -4,10 +4,17 @@ namespace Matplotlib {
void PlotView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(rect, KDColorWhite);
drawGrid(ctx, rect);
if (m_store->grid()) {
drawGrid(ctx, rect);
}
drawAxes(ctx, rect);
drawLabelsAndGraduations(ctx, rect, Axis::Vertical, true);
drawLabelsAndGraduations(ctx, rect, Axis::Horizontal, true);
for (int i=0; i<m_store->numberOfDots(); i++) {
PlotStore::Dot dot = m_store->dotAtIndex(i);
drawDot(ctx, rect, dot.x(), dot.y(), dot.color());
}
}
}