I guess it's time for me to finally get back at this post from a few years ago. From the lack of responses I guess that something like a Linear-Logarithmic axis is not the most popular of features. However, in the particular branch of science I'm involved in - analysis of time-resolved spectroscopy data
- it is widely used to present results from fitted data.Presenting results
This is because in the studies of photophysics, photochemistry and photobiology we attempt to investigate the dynamic properties of very complex systems by studying phenomena that occur on very varied time scales, ranging from "ultra-fast time scales
" (pico, or even femo-seconds) to relatively "longed lived time-scales
" (nano-seconds, mili-seconds or even seconds). Apart from the actual data-fitting itself, an important aspect of analysis is how to present these kind of results
in such a way that still makes sense and at the same time is useful to the researcher doing the analysis.Limitation of JFreeChart
If we would use a simple linear axis then Figure 1
demonstrates what the results would look like. As you can see ... well, not everything can be seen here, there are clearly some strange artifacts at time zero. This is because most of the physics is happening in the first few picoseconds
, but the total dataset stretches out for hundreds of picoseconds
. Zooming in does not help much either, the first 2 spectra remain hardly visible because they are on the 0.1 to 1 picoseconds timescale. Plotting this on a logarithmic scale is also not an option.Figure 1
: Time-resolved spectra on linear scaleIntroduction of LinLogAxis
Instead what we do is plot the first few picoseconds on a linear time scale
, occupying about 40% of the total axis space and plot the rest on a logarithmic time axis
occupying the remaining space on the axis. In order to realize this functionality in JFreeChart I had to write a new LinLogAxis
, deriving from ValueAxis, and a custom NumberFormatter. The results from the implementation of this new class are displayed in Figure 2
. As you can see the shapes of the first 2 spectra are now clearly visible while no information from the slower spectra is lost.Figure 2
: Time-resolved spectra on linear-logarithmic scaleReinventing the wheel
If you came this far in reading my post, you might ask yourself, what is the reason for posting this? Well the answer is simple ....
Recently I saw a physicsworld.com webinar titled "A Crack in the Code: Why software fails in scientific research, and how to fix it
The description was for this webinar was:
Millions of lines of code have been developed to support scientific research. Although an increasingly important part of almost all research projects, most of this software is barely fit for purpose compared with equivalent systems in the commercial world. The code is hard to understand and maintain, lacking documentation and version control, and is continually "re-invented" as the software developers move on to new projects.
Well, I also developed this linear-logarithmic "LinLogAxis" axis as part of my own research, and am about to move on to a new project. But having watched this seminar (briefly) I know what to do .... before I move on, I hope to contribute this new functionality to the JFreeChart code base - or at least put it out there in the public domain depending on the feedback. In the next few weeks I will be doing some internal testing and cleaning up to ready it for public release. In the meantime I was wondering the following ....Feedback
Is there anyone out there who is working with completely different kind of data but for whom this kind of functionality in JFreeChart would make a welcome addition? I ask, because I designed this LinLogAxis class with only one kind of data in mind, but maybe with a few minor modifications it might be made suitable for other kinds of data as well. Better to make those changes now than reinvent the wheel again ...