Maxima Function
dataplot (list)
dataplot(list,option_1,option_2,...)
dataplot(matrix)
dataplot(matrix,option_1,option_2,...)
Funtion dataplot permits direct visualization of sample data, both univariate (list) and multivariate (matrix). Giving values to the following options some aspects of the plot can be controlled:
'outputdev, default "x", indicates the output device; correct values are "x", "eps" and "png", for the screen, postscript and png format files, respectively.
'maintitle, default "", is the main title between double quotes.
'axisnames, default ["x","y","z"], is a list with the names of axis x, y and z.
'joined, default false, a logical value to select points in 2D to be joined or isolated.
'picturescales, default [1.0, 1.0], scaling factors for the size of the plot.
'threedim, default true, tells Maxima whether to plot a three column matrix with a 3D diagram or a multivariate scatterplot. See examples bellow.
'axisrot, default [60, 30], changes the point of view when 'threedim is set to true and data are stored in a three column matrix. The first number is the rotation angle of the x-axis, and the second number is the rotation angle of the z-axis, both measured in degrees.
'nclasses, default 10, is the number of classes for the histograms in the diagonal of multivariate scatterplots.
'pointstyle, default 1, is an integer to indicate how to display sample points.
For example, with the following input a simple plot of the first twenty digits of %pi is requested.
(%i1) load (descriptive)$ (%i2) load (numericalio)$ (%i3) s1 : read_list (file_search ("pidigits.data"))$ (%i4) dataplot (makelist (s1[k], k, 1, 20), 'pointstyle = 3)$
Note that one dimensional data are plotted as a time series. In the next case, same more data with different settings,
(%i1) load (descriptive)$ (%i2) load (numericalio)$ (%i3) s1 : read_list (file_search ("pidigits.data"))$ (%i4) dataplot (makelist (s1[k], k, 1, 50), 'axisnames = ["digit order", "digit value"], 'pointstyle = 2, 'maintitle = "First pi digits", 'joined = true)$
Function dataplot can be used to plot points in the plane. The next example is a scatterplot of the pairs of wind speeds corresponding to the first and fifth meteorological stations,
(%i1) load (descriptive)$ (%i2) load (numericalio)$ (%i3) s2 : read_matrix (file_search ("wind.data"))$ (%i4) dataplot (submatrix (s2, 2, 3, 4), 'pointstyle = 2, 'maintitle = "Pairs of wind speeds measured in knots", 'axisnames = ["Wind speed in A", "Wind speed in E"])$
If points are stored in a two column matrix, dataplot can plot them directly, but if they are formatted as a list of pairs, their must be transformed to a matrix as in the following example.
(%i1) load (descriptive)$ (%i2) x : [[-1, 2], [5, 7], [5, -3], [-6, -9], [-4, 6]]$ (%i3) dataplot (apply ('matrix, x), 'maintitle = "Points", 'joined=true, 'axisnames=["", ""], 'picturescales=[0.5, 1.0])$
Points in three dimensional space can be seen as a projection on the plane. In this example, plots of wind speeds corresponding to three meteorological stations are requested, first in a 3D plot and then in a multivariate scatterplot.
(%i1) load (descriptive)$ (%i2) load (numericalio)$ (%i3) s2 : read_matrix (file_search ("wind.data"))$ (%i4) /* 3D plot */ dataplot (submatrix (s2, 4, 5), 'pointstyle = 2, 'maintitle = "Pairs of wind speeds measured in knots", 'axisnames = ["Station A", "Station B", "Station C"])$ (%i5) /* Multivariate scatterplot */ dataplot (submatrix (s2, 4, 5), 'nclasses = 6, 'threedim = false)$
Note that in the last example, the number of classes in the histograms of the diagonal is set to 6, and that option 'threedim is set to false.
For more than three dimensions only multivariate scatterplots are possible, as in