Rounding of decimals in TikZ export

Dieter Vanderfaeillie shared this problem 4 years ago
Not a Problem

I had a very old very of GeoGebra, which used to do everything I wanted.


In the current version I'm using when choosing Export as PGF/TikZ decimal numbers are 'not' rounded, but appear in full expanded form. This ensures more precision when plotting but this is usually not needed. Rounding to 3 decimals is usually more then enough.


The current export shows somthing like this:

  1. \begin{tikzpicture}
  2. \draw [line width=1.2pt] (1.,-1.)-- (4.,-1.);
  3. \draw [line width=1.2pt] (5.060660171779821,0.060660171779821415)-- (5.060660171779821,3.0606601717798214);
  4. ...

Notice how integers have a decimal point -1. instead of just -1 and the long expansion of the floating numbers.

This could be uncluttered as: (as it was in the old version 3.2).


  1. \begin{tikzpicture}
  2. \draw [line width=1.2pt] (1,-1)-- (4,-1);
  3. \draw [line width=1.2pt] (5.06,0.06)-- (5.06,3.06);
  4. ..

Choosing a rounding in the options menu doesn't change this.

It would be nice if one could choose the amount of rounding in the TikZ export.


My current GeoGebra setup:

  1. GeoGebra 5.0.377.0-3D (12 July 2017)
  2. Java: 1.8.0_121
  3. OS: Linux

Comments (2)

photo
1

Sorry, we won't be changing this

photo
1

Okay, I respect the decision.


Since uncluttering the TikZ export is very time intensive I'm going to build my own version where I will add this option. I had a look a the code and identified the issue in *GeoGebraToPgf.java*.


Loading the project in Eclipse succeeds, but somehow the build is failing. I'll open a new bug report.

© 2021 International GeoGebra Institute