Tuesday, December 20, 2011

How to plot using pstricks(2) --- plot a data file

Function plotting have been talked last time, and today data file plotting will be introduced.

There are three fundamental data file plotting commands in pstricks, and we will show them one by one.

The first one is "\fileplot[parameters]{datafile}". The datafile should contain a list of coordinates. And the data can be delimited by "{}", "()", "," and one or more white space. If something is following "%", it will be interpreted as comments and will be omitted. It is advised to bracket all the data with "[]", this will significantly speed up the rate at which the data is read. So files like the following ones are all legal.

[(0,0),(1,1),(2,2),(3,3),(4,4)] %mydata


[{0  0}  {1  1}  {2  2}  {3  3}  {4  4}]

[0  0  1  1  2  2  3  3  4  4]

Now a simple practice on this command will be shown.


File mydata.dat is shown below:


And the output picutre looks like this:

Fig.1 Plot data file with command fileplot.

Files Download: tex ps pdf

Other file plot commands will be talked next time.

No comments:

Post a Comment

Creative Commons License
Except as otherwise noted, the content of this page is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.