saving graphs as png?

Hi,

How can i save a gauss graph file (*tkf) as png or jpeg? Thanks a lot..

 

1 Answer



0



The best answer is to create your graph using the new graphics, instead of the deprecated PQG graphics (which create the .tkf files). Just changing, a call like:

xy(x, y);

to:

plotXY(x, y);

Then you can either save the file programmatically with plotSave, like this:

plotSave("mygraph.jpg")

or you can export interactively by selecting File->Export Graph from the main GAUSS menu. In the GAUSS Help: User Guide->GAUSS Graphics->Interacting with plots in GAUSS->File Export, will show you how to interactively set the size and aspect ratio, giving you a live preview of exactly what the output file will look like.

Doing the above will give you more control over your graph, more file export options (PNG, TIFF, SVG, etc) and a nicer looking graph as well. However, you can export the PQG graph to a JPG file on Windows by adding the graphprt function before the graph creation like this:

library pgraph;
graphset();

x = seqa(0.1, 0.1, 10);
y = cos(x);

graphprt("-c=5 -cf=mypqg_graph.jpg");
xy(x,y);

On Mac or Linux, you will have to select File->Export->JPEG from the PQG viewer window.

aptech

1,773

Your Answer

1 Answer

0

The best answer is to create your graph using the new graphics, instead of the deprecated PQG graphics (which create the .tkf files). Just changing, a call like:

xy(x, y);

to:

plotXY(x, y);

Then you can either save the file programmatically with plotSave, like this:

plotSave("mygraph.jpg")

or you can export interactively by selecting File->Export Graph from the main GAUSS menu. In the GAUSS Help: User Guide->GAUSS Graphics->Interacting with plots in GAUSS->File Export, will show you how to interactively set the size and aspect ratio, giving you a live preview of exactly what the output file will look like.

Doing the above will give you more control over your graph, more file export options (PNG, TIFF, SVG, etc) and a nicer looking graph as well. However, you can export the PQG graph to a JPG file on Windows by adding the graphprt function before the graph creation like this:

library pgraph;
graphset();

x = seqa(0.1, 0.1, 10);
y = cos(x);

graphprt("-c=5 -cf=mypqg_graph.jpg");
xy(x,y);

On Mac or Linux, you will have to select File->Export->JPEG from the PQG viewer window.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy