Export of the figure

Previous Next

Menu item File export will allow you to export the figure under various formats.



Menu item File - export with unity in PNG file will allow the user to save the figure in a special PNG file, by specifying a lenth in centimeters for the unity length of the figure.

Once this file incorporated in a text editing software, the figure will have exactly the size desired (if the size is not to big to  fit in the document page).


Complementary information about exporting the figure in a dynamic web page using only JavaScript (html 5) :


The graphical output takes place in a  SVG (vectorial graph).

Using Microsoft explorer is as possible to be avoided to visualize this output (bad implementation of clipping).

When exporting in pure html 5 with MathGraph32, you will see such a code in the function go() :

var st = "Base 64 code of the figure";

mtg32App.addDoc("svg", st);

The first parameter "svg" of the second line is a reference to the SVG defined at the bottom of the page, with Id "svg".

If you want to include two figures in the same html page, you have to create in the page another SVG with, for instance,  "svg2" for Id (this SVG must be included in a DIV section), then you must add two other lines in function go() following the two preceding ones :

st = "Base 64 code of the second figure";

mtg32App.addDoc("svg2", st);


You can, of course, insert more than two figures in the same html page.


To get the base 64 code of a figure, you have to open this figure with MathGraph32, then use menu item "Edit - Copy figure code (for html)". The code of the figue is then inserted in the clipboard and then may be inserted in the html page after st =between the double quotes.


Complementary information on LaTeX Tikz code export :


There are two ways for the LaTex Tikz code export of teh figure:


A dialog box pops up :

If the figure has got a unity length, this one will stand for 1 cm.

But you can specify an enlargement-reduction ratio.

Each time this ratio is changed, the LaTeX Tikz code has to be regenerated.

If the figure has no unity length or if the Use unity length checkbox is not checked, MathGraph32 gets one centimeter on your screen for one centimeter on the exported figure, but you can also specify the enlargement-reduction ratio.

If the figure has an unity length and if the Use unity length checkbox is checked, the unity length wll stand for 1 cm in the LaTeX export.

You generate the LaTeX Tikz code by clicking on the Tickz Code generation button. The code appears in the text editor.

If you click on the Copy full code button, the generated code is copied in the clipboard. If you select a part of the code, the selected code is copied in the clipboard.

If you click on the Copy figure code button, only the figure code is copied in the clipboard (not the use of packages).

If the figure contains a background image or other images, these images are saved inpng files with a name beginning by the MathGraph32 figure name and ending with a number (number 0 for the background images) if present. These png files must be in the directory containing the LaTeX file while compiling if you wand them to appear in the LaTeX Tikz export.

The full code is directly copied in the clipboard. The enlargement-reduction ratio used is the ratio chosen in menu item Options - Preferences, tab Clipboard.



Complementary information about exporting the figure in a dynamic web page using an applet:


When using menu item File - Export to - Dynamic web page (html), a dialog box pops up.


In the upper part of the dialog box, you can enter a title for the page, the author name and the dimensions in pixels for the figure (Applet).


In the lower part of the dialog box :



If you select checkbox Include Jar file in export, the jar file of the applet will be exported in the same directory as the html file (recommended for local use, not connected to the internet).

If you don't select checkbox Include Jar file in export, the jar file will not be included in the export and the applet will be called on-line.


Then a file save dialog box will appear to choose the directory in which the export will take place.

Once the file saved, if your computer allows it, your default web browser will be launched with the html file generated.


Two  different kinds of export are available :