You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimalist graph and bar chart plotting library based on lib/draw (X11 drawing library, already implemented). This could be loosely inspired from Python's matplotlib. Should allow updating/redrawing the graphs dynamically as new data is added. This could be used, for example, to chart mathematical functions, or stock prices over time.
Example usage:
plot=require('lib/plot')// Draws a graph linking points by line segments// values is an array of y values// yMin and yMax are the range of the y axis// xMin, xMax and xDelta determine x values corresponding to point indicesplot.graph(canvas,values,yMin,yMax,xMin,xMax,xDelta)// Draws a bar graph with labeled barsplot.barChart(/* TODO: determine argument format */)
I would strongly advise not trying to cover every possible use case for the first version of this library, as this may increase the difficulty and complexity significantly. Comments/feedback welcome.
The text was updated successfully, but these errors were encountered:
A discussion with drbell in the chat prompted me to realize that it may be best if we could create reusable objects representing graphs. The API would then be more like this:
plot=require('lib/plot')varplot=newplot.Graph(yValues);plot.setTitle('Graph of Y values in function of X values');plot.setYLabel('Y values');plot.setXLabel('X values');plot.setYRange(0,100);plot.draw(canvas);
In this way, parameters could be set on a plot object. All parameters would be optional, so that only an array of y values is required to produce a graph in the most minimal case. The graph would automatically update on the next draw() call if the y values in the array change.
Minimalist graph and bar chart plotting library based on lib/draw (X11 drawing library, already implemented). This could be loosely inspired from Python's matplotlib. Should allow updating/redrawing the graphs dynamically as new data is added. This could be used, for example, to chart mathematical functions, or stock prices over time.
Example usage:
I would strongly advise not trying to cover every possible use case for the first version of this library, as this may increase the difficulty and complexity significantly. Comments/feedback welcome.
The text was updated successfully, but these errors were encountered: