BruceBlog

Saturday, October 18, 2008

Ploticus

I've been looking for a plotting package that I can drive from C++ and can plot data my software generates. I want something I don't need to spend a lot of time figuring out and that I don't need to link into my software. I'm trying Ploticus (downloaded from here). I'm running Windows.

I unzipped and placed the files into a directory structure. There doesn't seem to be any formal installation needed.

I ran the "run_test_script.bat" script to try it out. It reminded me to put pl.exe in my path, which I did, and then the script ran fine (with some warnings unrelated to drawing the plots).

I ran the "run_prefabs_test" script. After changing the path for the environment variable in the batch file, it ran fine also.

From the batch file, I figured out that the command line: pl -gif stock2.htm runs the stock2.htm script.

Now I'm changing the stock2.htm file to see if I can get things to work with my data. I'm ignoring documentation for now. My file looks like (the first few rows are below):

Date,Open,High,Low,Close,Volume,Adj Close
2001-11-26,52.37,52.37,52.37,52.37,000,47.07
2001-11-27,52.43,52.43,52.43,52.43,100,47.12
2001-11-28,52.43,52.43,52.43,52.43,000,47.12
2001-11-29,52.43,52.43,52.43,52.43,000,47.12

I had to change the date ranges (from the scrip file):

//xscaletype: date dd-mmm-yy // Original line
xscaletype: date yyyy-mm-dd // new line
xrange: 2001-11-26 2008-10-03

//stubformat: Mmmdd // Original line
stubformat: yyyy-mm-dd // new line
stubrange: 2001-11-26

The script ran, but the scales are way off.

I am resorting to the documentation. Just using Google and the term I'm looking for gets me to helpful information quickly. For example searching for "ploticus tincrement" let me pull up the appropriate documentation quickly.


Well, it worked out. I put symbols on the graph and figured out how to use command line options. Maybe I'll put more info on this blog when I have a bit more time.

0 Comments:

Post a Comment

<< Home