XYplot nDecimalPlaces only working on Yaxis

Support forum for MegunoLink
Post Reply
iaintrainer
Posts: 2
Joined: Wed Sep 27, 2023 3:37 pm

Thu Oct 26, 2023 9:54 pm

I am plotting data on an XYplot.

Here is the Arduino code that is sending the data. Note the 4 for nDecimalPlaces
void updateUserInterface() {
plotArticulation.SendData("Articulation", wirePullDistance, articulationAngle, 4 );
plotArticulation.SendData("Force", wirePullDistance, force, 4 );
}

The output that shows in the monitor looks like this. There are four decimal places for the Y axis data, but not the X axis data.
{XYPLOT|DATA|Articulation|-0.08|-11.0034}
{XYPLOT|DATA|Force|-0.08|1.2643}

How do I get four decimal places for the X axis data?

Jeff
Thanks,
Jeff
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Fri Nov 17, 2023 8:00 am

Hi Jeff, looks like maybe a bug in the library. You can see the library files here
https://github.com/Megunolink/MLP/blob/ ... y/XYPlot.h

I think maybe if you modify the same file on your computer by changing line 120 to be more like line 122 you should get decimal places for x value as well. Let me know if that works.

Phil
iaintrainer
Posts: 2
Joined: Wed Sep 27, 2023 3:37 pm

Mon Nov 20, 2023 3:57 pm

Phil,

Yes, changing line 120 in the library to be as shown below solves the problem and gives the same number of decimal places for both X and Y values.

m_rDestination.print(*xValues++, nDecimalPlaces);

Thanks,
Jeff
Thanks,
Jeff
Post Reply