A, B, or C? (GLCD Plot Algorithms)

Thread Starter

jpanhalt

Joined Jan 18, 2008
10,933
I have been playing with different ways to plot a temperature chart. X-axis is always one step. Plotting single data points is easy, but I don't like how it looks when the temperature change is more than 2° (1 pixel per degree). Here are three exaggerated examples of up and down results. In practice, the chart will be mostly up or no change and cooling will be mostly down or no change. Screen will be approximately 64 x 64 pixels. Y-axis is 8, 8-pixel high pages.

Which do you prefer? (Open circles are the actual data points. Trend line is in green. Red line is the demarcation between two hypothetical pages.)

1607194553629.png

From the standpoint of coding, B is probably a tiny bit easier than A (i.e., previous datapoint does not need to be OR'ed) and is closer to the Bresenham line. Either A or B is easier than C. Clipping only one pixel off the 5th datapoint in B would be at least as difficult as C alone.
 

ericgibbs

Joined Jan 29, 2010
11,577
hi John,
I would use a regular histogram plot from a common base line.
Also do you plan to say left shift the plots as the plots reach the right side end of the display.?
So that the latest plot will always be at the last Column
E
 

Thread Starter

jpanhalt

Joined Jan 18, 2008
10,933
Right now, I do not want a histogram. Easy to do, but for now I am a line graph person. May change as time goes on. They do look nice. This project was functionally done 18 months ago (big Spring, Summer, and early Fall break). Right now, I am just having fun with coding to see if I can make it do what I want it to do.

As for graph range and scrolling, yes, those are set up. If either Y-max or Y-min is met while adding a new point, the whole graph is scrolled. Right now, I scroll 5 pixels so I don't have to change the Y-axis tick marks. That's adds a bit more complication because rows are 8-pixels high and each point has to be re-calculated. So far, that scroll is not very noticeable. X-axis (time) scroll is also 5 pixels, and that is not much of a problem. My byte calculation routines are fast enough that I only store raw data (i.e., temperature) and recalculate the entire screen on every scroll. The main difference is that once a new datapoint causes a scroll up or down or X-axis, range testing on earlier data is limited to finding whether the data point on axis, which creates a skip, or in range. If I didn't do that, I could envision the screen going crazy if the temperature range during an hour (X-axis max) exceeded Y-max/Y-min. ;)
 

nsaspook

Joined Aug 27, 2009
7,868
You must be close to finishing this project.;)

After a rescale.
1607194553629.png
A: Just looks bad.
B or C: I would pick B because while the displayed trend is not pixel accurate the visual of change is more apparent.
 

Thread Starter

jpanhalt

Joined Jan 18, 2008
10,933
Yes, it is all about looks. For example, for a rise of, say 3°, I go diagonal rather than horizontal, which looks "clunky" to me. Plus, it is kind of fun butchering bits..
 
Top