mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 16:20:49 +01:00
[python] Add an "axis" function to the matplotlib module
This commit is contained in:
committed by
Émilie Feral
parent
c99bed6922
commit
6a796f5f7c
@@ -3,19 +3,41 @@
|
||||
|
||||
//#include <apps/shared/curve_view_range.h>
|
||||
#include <apps/shared/interactive_curve_view_range.h>
|
||||
extern "C" {
|
||||
#include <py/runtime.h>
|
||||
}
|
||||
|
||||
namespace Matplotlib {
|
||||
|
||||
class PlotStore : public Shared::InteractiveCurveViewRange {
|
||||
public:
|
||||
PlotStore() : Shared::InteractiveCurveViewRange() {}
|
||||
/*
|
||||
float xMin() const override { return 0.0f; }
|
||||
float xMax() const override { return 1.0f; }
|
||||
float yMin() const override { return 0.0f; }
|
||||
float yMax() const override { return 1.0f; }
|
||||
*/
|
||||
PlotStore();
|
||||
void flush();
|
||||
|
||||
class Dot {
|
||||
public:
|
||||
Dot(float x, float y, KDColor color) : m_x(x), m_y(y), m_color(color) {}
|
||||
float x() const { return m_x; }
|
||||
float y() const { return m_y; }
|
||||
KDColor color() const { return m_color; }
|
||||
private:
|
||||
float m_x;
|
||||
float m_y;
|
||||
KDColor m_color;
|
||||
};
|
||||
|
||||
// TODO: Use an iterator here. It will be a lot faster
|
||||
Dot dotAtIndex(int i);
|
||||
int numberOfDots();
|
||||
|
||||
void addDots(mp_obj_t x, mp_obj_t y);
|
||||
|
||||
void setGrid(bool grid) { m_grid = grid; }
|
||||
bool grid() { return m_grid; }
|
||||
private:
|
||||
mp_obj_t m_dots;
|
||||
bool m_grid;
|
||||
|
||||
/*
|
||||
mp_obj_array_t * m_plots;
|
||||
mp_obj_array_t * m_arrows;
|
||||
|
||||
Reference in New Issue
Block a user