0.14.1. Update as usual with:~ gem update ctioga2If you're not using Ruby 2.3, you probably don't need to update soon, though. Enjoy !
A blog from a scientist and former Debian developer (and occasional book writer)... Tricks for data handling, programming, debian administration and development, command-line and many other joyful things in the same spirit. Oh, and sometimes completely unrelated things !
0.14.1. Update as usual with:~ gem update ctioga2If you're not using Ruby 2.3, you probably don't need to update soon, though. Enjoy !
~ gem update ctioga2An updated Debian package should find its way to the archive later on today. Have fun !
ctioga2 away from rubyforge, to sourceforge. Transition went smooth, git is now the only VCS. Code is hosted at sourceforge and mirrored at github.Work goes on on ctioga2. I've recently implemented a decent support for histograms. It is already much more powerful than the one in the old ctioga, but it is far from being feature-full. Here's a preview.I'm slowly preparing a new release for ctioga2, that would incorporate quite some fixes since the last time, and quite a few nice features in addition to the histograms. Stay tuned !
ctioga2 since my last post. Among the most interesting features, ctioga2 now features:gnuplot'simpulses plot styleThe latter feature proved actually instrumental in a research project under way in my lab (which is why I wrote it in the first place). It is demonstrated in the image above, made using this code.
I've also started the gnuplot versus ctioga2 gallery I was speaking about in my last post, where I try to reproduce most of gnuplot's examples using ctioga2; it can be found here. While I don't like so much the look of the gnuplot graphs, and I try to keep the look of ctioga2's as close as possible to that look, it proved invaluable in detecting small bugs, fixing small glitches and providing inspiration for new features.
In the meantime, my todo-list for ctioga2 doesn't seem to get any smaller. Let's hope I'll implement them fast enough ! Keep posted...
fopen(file, "w") for binary files, that don't make any difference on Linux and Mac, but that do on Windows...). The release is already available on the rubyforge download page. Gems will be available later on today.To actually make it work on windows, here is what you need to install:
cmd.exe) and run:gem install tioga
And that's it ! That also means that ctioga2 works on windows, if you run:
gem install ctioga2
0.5 of ctioga2, my plotting program. While there is still quite a lot of improvements I'd like to get in some day, the past few days have seen a lot of activity. Probably the most important change is the new space-separated command file format, much simpler than the old one (which is still supported, although marked clearly as deprecated now). Another important change for the users is the large improvement of error reporting: in most cases, ctioga2 pinpoints the exact location where things go wrong; it also features reporting on LaTeX errors. The last important feature is also the introduction of real contour plots, such as the one below, coming from the documentation:Now, I feel like ctioga2 is coming close to gnuplot in terms of features and ease of use. Part of my plans for the website is to create a gnuplot mockup gallery, in which I would take as many examples from the gnuplot website as possible (ie all the ones ctioga2 can reproduce) and compare the code and look of both.
Among features I'd like to implement for ctioga2, here are the ones that I think are the most important ones:
plot with instruction of gnuplotBut maybe you have other ideas you'd like to see before that ?
ctioga, I was compelled to see my initial design mistakes, and think about a complete rewrite.
This is where ctioga2 was born, some time at the beginning of 2009. I completely stopped using the old ctioga a few month after starting to work on ctioga2, but it took ages before I finally came up with a decent enough documentation to release and announce publicly. But now, it's done, and the first public release of ctioga2 is out, still fresh !
Here are a few highlights of the differences:
/option value that allow many small tweaks I had never had the courage to write for the old ctioga as it was way too painful to add new commands there.ctioga2 can be driven both from command-line and using command files, in the style of gnuplot, which is the reason why I call it polymorphic.ctioga2, in the form of color maps (that's what is shown here).ctioga and that miss from ctioga2, such as histograms. When I have some time and/or motivation...In any case, you can make yourself an opinion of ctioga2 by looking at the galleries.
Enjoy !
diff <(man -a -l $HOME/SciYAG/ctioga/doc/ctioga.1 | \ egrep -o -- '--[a-z0-9-]+' | sort | uniq) \ <(ctioga --help | egrep -o -- '--[][a-z0-9-]+' | \ sort | uniq) | colordiff | less -R
(of course, I broke it into lines for clarity). It is based on process substitution, a shell trick that lets you use the output/input of a shell command exactly as a file on command line. Neat ! The trouble is, replacing the colordiff... part by | egrep '^>' | wc tells me there are 65 undocumented features... Lots of work in perspective, and I'm not sure I'll do it all before the 1.9 release...
I've however realized that now, what ctioga is missing the most is real flexibility over the coordinates. For now, all coordinate positions are either relative to the frame (such as for --inset) or to the graph (for --draw). What I really wish is a way to mix all kind of coordinates: real size (1cm), frame position and graph position. That will require quite a fair deal of work, of course, but that shouldn't be too difficult... I'll go on posting about it here.
Much as been done on ctioga since the last release, not even two weeks ago: small bug fixes, tangents improvements, the rebirth of a --subplot option, a saner framework for plot styles... But the most significant improvement in my opinion is the possibility to make non-linear axes: you just need to provide a two-ways transformation between the standard coordinates and the axis coordinates, and ctioga does the rest:
ctioga -N --xpdf --math --math-xrange 2:8 \ 'sin(x)' --xaxis bottom --new-axis biniou top \ --axis-function biniou 1/x 1/x \ --lines-color biniou Gray --no-title
As you can see, I did profit to add the possibility of background lines corresponding to the axes' major ticks. The only real trick that is left is to find a decent way to partition the target segment so that they ticks are "natural" (not 0.34759, for instance) and reasonably equally spaced. I thought other plotting programs had dealt with this, but in fact, that doesn't seem to be the case: I'll have to do that myself.
I've had a recent confirmation with ctioga, a project of my own. I just need to decide to release a new version to realize just afterwards that I've got many more features to add (not less than 20 significants commits since the release a week ago !)... Life is not linear ! (and I won't complain).
So what ? I won't use ctioga for playing with my models, as it has not been designed with interactivity in mind, and will most probably never be (that would somehow defeat it's purpose). But I don't want to do the same work twice, especially if the second time is way more tedious than the first...
So I wrote a new backend, gnuplot, whose job is to feed a file to gnuplot and tweak it so that ctioga gets the data of all the plots. Imagine you have a file biniou.gnu in the spirit of
a(x) = x**2 + 2*x + 1 plot a(x), x**2 - x
Then, you can plot both a(x) and x**2 - x with the following command-line:
ctioga --gnuplot biniou.gnu@1##2
Note that it only takes data ! Style is completely dismissed.
ctioga. I'm thinking mainly about the pain of writing, say,
ctioga --math --math-samples 200 'sin(x)'
when one would rather like to write
ctioga --math --samples 200 'sin(x)'
Starting from SVN revision 637, the latter form is possible. Specifically, when an option is not recognised, ctioga tries the following:
ctioga uses a shortcut--samples for --math-samples), the corresponding option is usedctioga complainsYou can see the beauty of these options in the attached graph, produced by:
ctioga --xpdf --math --samples 200 \ --cloud --filled 'sin(x)'
On ctioga's forum, I was asked to provide a way to turn tick labels - which there currently wasn't. But, in fact, the structure was already there. The SVN commit 632 has seen them in. See for yourself the result of
ctioga --xpdf --math --interpolate 'sin(x)' --scale yticks 2.2 --angle xticks 45
As with the title and other friends, options are available, to control the shift, scale and angle of the ticks. However, the color cannot currently be changed this way (this is a Tioga limitation).
He said that this library was producing great plots (he saw directly plots made by its creator, Bill Paxton). When I saw this video, I was sincerely convinced !
So then, as the library was only for the Ruby programming language, I started immediately to learn Ruby, using the Pragmatic Programmer's Programming Ruby. I found it an extremely enjoyable experience. Within an hour, I had made my first Ruby script using Tioga. Before the end of the day, I was sending my first bug report to Bill. The following day, I had already started to work on a (very poor at that time) first version of ctioga...
I've gone on working with Ruby ever since... I wrote no less than 9000 lines of code only in the SciYAG project on Rubyforge, not mentioning other projects using Ruby and the countless scripts I have written for my everyday science... Ruby is extremely comfortable to program with. A pure delight !