1. Download and install the library according to the README file.
2. Copy /usr/local/dislin/dislin.h to /usr/local/include/
3. Copy /usr/local/dislin/libdislin.a to /usr/local/lib/
Now it should work using the following options when compile the program.
> g++ test.cpp -lXt -ldislin -lm
Don't forget the -lXt
Another option is:
> g++ test.cpp /usr/local/dislin/lib/dislin-9.1.a -lm -L/usr/X11R6/lib -lXt
I assumed in the above example that dislin is installed in: /usr/local/dislin/. There is no need to change /etc/profile or set the envionment varibles as the README suggested. Here is a very useful link:
http://people.scs.fsu.edu/~burkardt/cpp_src/dislin/dislin.html
Use dislin:
//
// Specify the format of the output file.
//
// metafl ( "PNG" ); //if want to save as png file
metafl("XWIN"); //this just show the graph on screen
//
// Specify the name of the output graphics file.
//
// setfil ( "dislin_ex01.png" ); //only when you want to save the figure.
disini ( );
pagera ( );
complx ( );
axspos ( 450, 1800 );
axslen ( 2200, 1200 );
name ( "X-axis", "x" );
name ( "Y-axis", "y" );
labdig ( -1, "x" );
ticks ( 10, "xy" );
titlin ( "Demonstration of CURVE", 1 );
titlin ( "SIN(X), COS(X)", 3 );
graf ( 0.0, 360.0, 0.0, 90.0, -1.0, 1.0, -1.0, 0.5 );
title ( );
color ( "red" );
curve ( xray, y1ray, N ); //This is the data transfer part.
color ( "green" );
curve ( xray, y2ray, N );
color ( "fore" );
dash ( );
xaxgit ( );
disfin ( );
5/16/07
Install and use dislin under linuxe (debian).
Labels:
Programming related
Subscribe to:
Post Comments (Atom)
1 comment:
hey! the content is great :)
thnx 4 this
but could u please tell me y am i not getting to see the dislin folder in /usr/local and how to copy all these files u told, in place??
Puzzled please quickly guide me thru so that i can write the code in C and have my plotted curves..
Post a Comment