-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Upgrade Serial Plotter #5443
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
Upgrade Serial Plotter #5443
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Math used to generate extra ticks is quite complicated but looks ok
I hope Arduino devs can merge this since it makes the Serial Plotter much more useful. If there are issues with the way I did things let me know? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, I reviewed it and is ok overall, I just want to let the theme.txt file control the missing colors of the graph (as indicated in the inline comments), may you make this change?
private final Font font; | ||
private final Color bgColor; | ||
private final Color gridColor = new Color(245, 245, 245, 245); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This color should be put into the theme and retrieved with something like Theme.getColor("plotting.gridcolor")
@@ -132,16 +134,58 @@ public void paintComponent(Graphics g1) { | |||
Rectangle2D fRect = fm.getStringBounds(String.valueOf(tick), g); | |||
xOffset = Math.max(xOffset, (int) fRect.getWidth() + 15); | |||
|
|||
g.setColor(Color.BLACK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And probably this one too, even if it wasn't present before, it may be encoded as plotting.axiscolor
Even better, I like using the theme.txt for the grid colors, still trying to get handle on how everything fits together. I'll try to make this work. |
Thank you! |
This adds a x-axis and labels, grid lines, more y-axis ticks and moves Serial Baud Rate combo box to the other side to reflect the look of the Serial Monitor. It also scales right when the window is scaled.

Before:
After:
