Skip to content

Improve serial plotter graph colors #5656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2016

Conversation

cousteaulecommandant
Copy link
Contributor

I've noticed that the multi-plot feature of the serial plotter has too few colors; it starts cycling after 4 colors. (Also I personally don't quite like the current colors.)
This patch increases the number of colors to 8 and uses a brighter, more saturated palette so that the colors are easy to distinguish even by people with reduced color perception (blue, red, green, amber, purple, gray, aqua, black).

I made this palette a while back for plots used on technical reports because I didn't like the default one on Excel/Gnumeric, and I think it looks rather nice for line plots. I thought it could be useful for Arduino too.

Example with 4 colors:
plot_4colors

Example with 8 colors:
plot_8colors

Code used to generate the example (in case you want to try this):

static byte randomize(byte &data, byte factor) {
  data += (random(256) - data) / factor;
  return data;
}

void setup() {
  Serial.begin(115200);
}

#define PLOTS 8
#define FACTOR 16
static byte plots[PLOTS] = {0};
void loop() {
  for (int i=0; i<PLOTS; i++) {
    Serial.print(randomize(plots[i], FACTOR));
    Serial.print(",");
  }
  Serial.println();
  delay(10);
}

Number of colors used by serial plotter increased from 4 to 8.
Improved colors (brighter; easy to tell apart):
blue, red, green, amber, purple, gray, aqua, black.
@facchinm facchinm added the feature request A request to make an enhancement (not a bug fix) label Dec 1, 2016
@cmaglie cmaglie merged commit 42f996e into arduino:master Dec 29, 2016
@cmaglie cmaglie added this to the Release 1.8.1 milestone Dec 29, 2016
@cousteaulecommandant cousteaulecommandant deleted the patch-4 branch January 11, 2017 20:52
@per1234 per1234 added the SerialPlotter Tools > Serial Plotter label Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A request to make an enhancement (not a bug fix) SerialPlotter Tools > Serial Plotter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants