Charts

Table of Contents

Introduction
XY Plots
Fitting XY Chart Data
Bar Charts
Statistical Charts
Chart Menu

Introduction

NMRViewJ incorporates a sophisticated charting library, JFreeChart (http://www.jfree.org/jfreechart/) for the graphical display of data. In NMRViewJ, this library is integrated into the canvas widget. This allows developers and users to generate canvases that combine all the normal canvas items such as lines, circles, rectangles, and text, with xy and bar charts.

This chapter will demonstrate how to generate your own charts within NMRViewJ. Since the primary use of charts in NMRViewJ is to plot data extracted from NMR experiments the main interface to the charting is through scripts. Charts are generally displayed in a toplevel window created with the figure command, though they can be inserted into any canvas in the program. The figure command can be issued with zero or one arguments. With no arguments it generates a toplevel window with a title like "Figure 1". Each time you issue the figure command it will increment the numerical suffix to give you "Figure 2", "Figure 3" etc. If you give invoke the figure command with one argument, the new figure will have that argument as its title. So "figure Relaxation" will give you a figure with title "Figure Relaxation". Subsequent charting commands will be directed at the currently active figure. You can activate a figure by either clicking on its window, or by issuing the figure command with an argument that is the title of an existing window.

Plots are created within figure windows with one of three plotting commands, plot to create XY (scatter) plots, barplot to create Bar Charts, and statplot to create Bar Charts where each item as an indicator of the statistical deviation of the data. If no figure exists already, these three commands will first call the figure command to create one. If you're in Premium mode, you can also create a new Figure with the CanvasNew Figure menu item.