Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Make 20 colors available for line plots

Open beyarkay opened this issue 2 years ago • 2 comments

This change modifies theme.txt so that there are 20 colors available for Arduino's serial plotter.

These colors are taken from matplotlib's tab20 color theme, and can be recreated like:

$ python3
Python 3.9.13 (main, May 24 2022, 21:13:51)
[Clang 13.1.6 (clang-1316.0.21.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> import matplotlib.pyplot as plt
>>> for c in plt.cm.tab20.colors: print(matplotlib.colors.to_hex(c))
...
#1f77b4
#aec7e8
#ff7f0e
#ffbb78
#2ca02c
#98df8a
#d62728
#ff9896
#9467bd
#c5b0d5
#8c564b
#c49c94
#e377c2
#f7b6d2
#7f7f7f
#c7c7c7
#bcbd22
#dbdb8d
#17becf
#9edae5

This means that up to 20 individual time series can be plotted before the colors recycle, and these 20 colors are also reasonably different from each other so that you can tell them apart.

All Submissions:

  • [x] Have you followed the guidelines in our Contributing document?
  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. [x] Does your submission pass tests?
  2. [x] Have you lint your code locally prior to submission?

Changes to Core Features:

  • [x] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [x] Have you successfully ran tests with your changes

beyarkay avatar Jun 28 '22 17:06 beyarkay

First time contributor here, please let me know if there's any changes I should make! love the tool and am happy to help out. This was a personal gripe of mine, as I'm currently working on a project that needs 15 sensors (accelerometer data in 3 dimensions for 5 fingers).

beyarkay avatar Jun 28 '22 17:06 beyarkay

Is this repo still monitored?

beyarkay avatar Jul 16 '22 10:07 beyarkay