Using R to create/draw nomograms

Software to make nomographs or nomograms
Glen
Posts: 67
Joined: Fri Jan 25, 2008 4:11 am
Location: Australia

Using R to create/draw nomograms

Postby Glen » Sun Jan 10, 2010 12:58 am

Having failed for what must be the fourth time to install MikTeX on my machine (the machine is having problems and the large/long install tends to make it overheat and crash), I temporarily put aside my attempts to get PyNomo going on my machine.

Instead I decided to see what I could do in the free package R (http://www.r-project.org, downloadable from cran.r-project.org), since I had already been playing around with using R to fit nomograms to data.

Yesterday I wrote a little function to draw a "curved" scale (from a sequence of points), place tick marks and labels (a fairly basic one, without lots of bells and whistles). It took about 15 lines of code. Then after setting up the data from the parametric equations for a simple nomogram (one with two straight scales and a curved scale) I called it 3 times to plot them (about another 15 lines). It works surprisingly well, considering how little effort was involved.

This was in a vanilla install of R (under windows in my case, but R works on linux/unix/mac), without any additional packages (of which there are thousands).

Once I have played with it a bit more and done a few good examples, I will post some links here (to code and examples, not that there's anything edifying about my code).
Glen
Posts: 67
Joined: Fri Jan 25, 2008 4:11 am
Location: Australia

Re: Using R to create/draw nomograms

Postby Glen » Sun Jan 10, 2010 6:39 am

I haven't produced any nice examples yet, but I have put the example I was playing with and the presently kludgy code, here: http://mathbric.blogspot.com/2010/01/cr ... -in-r.html

My tick-mark angles aren't quite right - they don't come out quite at right angles to the curved scale. I believe I know why, but I am not going to try to fix that at the moment.

It doesn't come close to matching what PyNomo can do, of course, but it's not bad for an afternoon of playing about. With the function to draw the scale done, I can knock up a (pretty basic) three-scale nomogram in a few minutes.
ScottF
Posts: 1
Joined: Wed Feb 11, 2009 4:59 am
Location: Illinois, near Chicago

Re: Using R to create/draw nomograms

Postby ScottF » Tue Dec 07, 2010 1:32 pm

Glen,

Are there any updates on your attempt to use R?
Glen
Posts: 67
Joined: Fri Jan 25, 2008 4:11 am
Location: Australia

Re: Using R to create/draw nomograms

Postby Glen » Wed Dec 08, 2010 6:11 am

[quote="ScottF"]Glen,

Are there any updates on your attempt to use R?[/quote]

Wow, I didn't think anyone was interested.

I did a little more, but I guess I ran down some side alleys since then. Besides spending a lot more time learning R, I've been playing a little with making slide rules/slide charts in R (a supposedly less complex task, but my brain has been slow at figuring out some of the issues) before returning to the nomorgams side of things. I should have another go at it.

On the other front, it looks like I did manage to get MikTeX to install a few days ago, so I could also give PyNomo another try at some point. Since R and Python can supposedly communicate, it may even be possible to do something with both.

Return to “Software”

Who is online

Users browsing this forum: No registered users and 1 guest