A quick Arduino Plotter Fix

The new Arduino IDE has a lot of powerful features. Unfortunately the plotter app is not one of them. It can be frustrating, but there is a fix.

Out of the box the Arduino 2.x plotter only displays 50 data points at a time. This is not enough for seeing many trends in sensors and other contexts. The new UNO R4 Minima makes this situation even worse as it is 3x faster than the R3! Which means out of the box, data blasts past far to quickly to see what is going on inside our Arduino.

This post is all about making the 2.x plotter wider so you can get the most out of this tool.

You have to do this every time you update your Arduino software!

Modding Software

To adjust the plotter we need to follow the solution posted in this Arduino issues thread: https://github.com/arduino/arduino-ide/issues/803, specifically this post: https://github.com/arduino/arduino-ide/issues/803#issuecomment-1338149431 . Hats off to the user Alex-Tsyganok  who posted the solution.

UPDATE NOTE

The posts above gives us the strategy, but the path to the file we need to mod has changed since the solution was first shared. The above solution worked until at least Aug 2023. But as of October 2023 the needed file has moved.

The rest of this post is based on above using the current file structure.

R3 Uno vs R4 Uno

Our goal is to setup the plotter so that it displays more than the default 50 points at a time. The process is the same for all Arduinos, but the scale shift is different depending on your board.

Older R3 Uno need you to change to at least 500
Newer (2025 onward) Minima needs you to change to 1500

Holy Minimas are FAST … thanks to 2025 tangible student Emily K. for first pointing out that 500 is not enough !

Please note — YMWV — I am working on my own machine to find a balance between the size of this change and functioning of the plotter. Over 4000 seems to crash the plotter for me. I have found that even with the plotter adjustment , that on the minima i have to add a small delay (2) to each loop to make simple events visible in the plotter. A very short timer would be better in VERY time sensitive cases. I will update if other solutions present themselves.

The Task

We are going to track down the serial plotter software inside Arduino IDE and mode the file so that 500 points are displayed.

Test COde

Cut, paste and upload the following code using IDE 2.x to test your plotter as you work through this mod. (This is not needed in IDE 1.x).

// simpleSquareWave generator
// plotter test code 

unsigned long interval = 50;
unsigned long start = 0;
unsigned long now = 0;

int STATE = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
   now = millis();

   if ( (now - start) > interval){
      STATE = 1 - STATE;
      start+= interval;
   }

   Serial.println(STATE);

   delay(10); 
  
}

Video

Here are video instructions for OSX — text follows with search terms and paths spelled out. (Any one on windows want to make a video of this ? )

Note the video says change to 500 — it is using an R3, for R4 minima try 1500.

PATH

Oct 2023 path:

The file we want can be found here:

Arduino —> Contents —> Resources —> app  —> lib —> backend —> resources —> arduino-serial-plotter-webapp —> static —> js —> main.35ae02cb.chunk.js

ON OSX:

Find the Arduino IDE icon (the app icon – not your sketchbook) in finder and right click. Then click on SHOW PACKAGE CONTENTS to get to Contents folder then navigate as described above.

ON WINDOWS:

Right click on the Arduino IDE shortcut and select “Open file location”. From there follow the path

 \resources\app\lib\backend\resources\arduino-serial-plotter-webapp\static\js  

[thanks David Bouchard for confirming the path and the search tip.]

File to FIND:

Once you get to the .js file you are looking for:

 main.35ae02cb.chunk.js

Duplicate it and change name to old_main.35ae02cb.chunk.js — to back it up.

Then,

Open the original file in a text editor and find/search for the following line:

U=Object(o.useState)(50)

For R3 — change that line by adding a zero (0) in the brackets to make 500

U=Object(o.useState)(500)

For R4 minima — change that line to 1500

U=Object(o.useState)(1500)

Save the file. Do not change the name.

With some computers / setups you may need to change permissions to save. It will be ok (see below). Go for it.

At this point the plotter is modded — you can test.

Permissions and Saving

You may need to enable ‘Write’ permission on the file to save your changes. If you try to save and it throws a warning about not being allowed, try the following:

OSX

In FINDER, right click the file and click Get Info or simply highlight the file and on keyboard click BUTTERFLY-I (butterfly is command).

The bottom of info window is permissions. Unlock the window (bottom right icon — enter password if you need to) – then for your user name OR everyone select Read and Write. Re-lock window for good measure.

You should now be able to save.

Windows

Navigate to the file we are modding and open settings. Different Windows versions may do this differently …

In File Explorer click on the file and then on keyboard press Alt-ENTER or with mouse ALT-Double-click this should give a settings window.

Link to additional methods if those don’t work (none of these are tested).

Once you have the settings window open … select SECURITY tab.

In that tab — select USERS in Group or user name frame, click EDIT (i don’t know which of those comes first), click the box for WRITE, ALLOW which should now be visible and click OK to save changes.

That should do it (i hope). You should be able to save.

Thanks to Rosalind P from tangible 2023 for help explaining the windows fix and sending along the images. All errors are mine.

Back to Arduino

In the Arduino IDE, with the above test code running, reopen the plotter and if all is well, you will see the now much wider wide plotter dancing before you.

Nailed it. Applaud self — get on with day.

If you have trouble opening the plotter, restart Arduino. And try again.

If it has really gone wrong — i did mess this up once to see what a worst case scenario might look like — you can reinstall Arduino 2.x.x and start again. No harm done.

Going Further

If you have not already done so, you can jump over to this building block and learn the Serial object basics.