kill(all)$

Maxima : special packages ,read ,write ,data ,plot
peter.vlasschaert@gmail.com,17/01/2019.

intro 
====

see : website.
===========

new: 16/01/2019:Maxima : Export from data 'Spreadsheet from LibreOffice ,Calc '
download  (Maxima,code)             :analyticalchemimportdatafromlibreofficecalcfinal
download  (Maxima,png)               :analyticalchemimportdatafromlibreofficecalcfinaloutp
download  (LibreOffice(Calc,txt) :datah2alogtab.txt
new: 17/01/2019:Maxima : plot  data ( = discrete) from a Matrix
download  (Maxima,code)       :MaximaMatrixtolistforplotmaxima
download  (Maxima,png)         :MaximaMatrixtolistforplotmaximaoutp

general packages ( for every session)
================================

load(lrats)$

A : read
=======

read : data files.
-------------------------
you need to know the full path : *.txt 
rem : extension  = txt

Windows path : C:\Users\Chem1\Desktop\studie\numdatacolumn.txt
Maxima    path :  C:/Users/Chem1/Desktop/studie/numdatacolumn.txt

read : data column.  ( file:numdatacolumn.txt )
================

=>  syntax :read_list("file location path .extension")
-----------------------------------------------------------------------------
file:  1
         2
         3
         4
         5

p1:read_list("C:/Users/Chem1/Desktop/studie/numdatacolumn.txt");

p1a:p1[4];
p1b:p1[5];

p1c:p1a+p1b;

min , max  "value".
---------------------------

p1d:[lmin(p1),lmax(p1)];

read : data columns.  ( file:numdatacolumnscomma.txt )
=================

rem : delimter  'see website'
      b) libreoffice(calc) :How to export data , with delimiter of choice ( csv file, TXT)
            download  (libreoffice(calc),pdf)       :exportwithdifferentdelimiter

=>  syntax :read_list("file location path .extension")
-----------------------------------------------------------------------------
delimiter : ,
-----------------------------------------------------------------------------
file:  1,6,11
         2,7,12
         3,8,13
         4,9,14
         5,10,15
-----------------------------------------------------------------------------

p2:read_matrix("C:/Users/Chem1/Desktop/studie/numdatacolumnscomma.txt");

p2a:p2[1,1];
p2b:p2 [4,3];

p2c:p2a+p2b;

=>  syntax :read_list("file location path .extension")
-----------------------------------------------------------------------------
delimiter : tab
-----------------------------------------------------------------------------
file:  1 6 11
         2 7 12
         3 8 13
         4 9 14
         5 10 15
-----------------------------------------------------------------------------

rem : math ' representation:matrix'
=============================

p3:read_matrix("C:/Users/Chem1/Desktop/studie/numdatacolumnstab.txt");

p3a:p3[4,2];
p3b:p3[3,3];

p3c:p3a+p3b;

find 'min' and 'max' :for each column of the matrix 'p3'.
=============================================

load package : smin,smax
----------------------------------------
syntax : smin(list or matrix)
                smax(list or matrix)
-----------------------------------------

load(descriptive)$

p4:smin(p3);
p4a:smax(p3);

 =====================================
 find : absolute (min)  for matrix 'p3'  => lmin
            absolute (max) for matrix 'p3'  => lmax
=====================================

p5:[lmin(p4),lmax(p4a)];

rem : find 'min,max' plot ranges.

B : write
=======

example : write matrix to file.
-------------------------------------------

p5:zeromatrix(2,2);

rem : E and e for the exponent

@ entries to matrix 'p5'
----------------------------------

p5a:p5[1,1] : 45;
p5b:p5[1,2] : 123;
p5c:p5[2,1] : 7;
p5d:p5[2,2] : 1e-05;

p6:p5;

=>  syntax :write_data([data],"file location path .extension")

p6a:write_data(p6,"C:/Users/Chem1/Desktop/studie/numdatamatrix.txt");

rem : windows created
file:///C:/Users/Chem1/Desktop/studie/numdatamatrix.txt

read : data file 'numdatamatrix.txt'
=>  A :read

p7::read_matrix("C:/Users/Chem1/Desktop/studie/numdatamatrix.txt");

change element from matrix: '1.0*10^-5'
-----------------------------------------------------------

p7a:p7[2,2] : 0;

p7b:p7;

rem : writefile("C:/Users/Chem1/Desktop/studie/maximasession.*") 

How to use : with_stdout
======================

? with_stdout;

rule : always save your data with tab delimiter.
free : office software : 'LibreOffice,Calc'

plot data : scatterplot ([list] or matrix ,options)
======================================

p8:p3;

wxscatterplot(p3, xrange=[1,15],yrange=[1,15]);

p8a: matrix(
 [1,2], 
 [5,6], 
 [7,8], 
 [9,5], 
 [15,4]
);

wxscatterplot(p8a, xrange=[-1,16],yrange=[-1,10], xaxis = true, xlabel = "x",
    yaxis = true ,ylabel = "y",   title= "data" ,color = red,grid =true,xtics = 1,ytics =0.5,
  point_type = filled_circle,point_size = 2);
 
    

?  scatterplot;

rem :  general use
===============

info : help graphics option 
======================

rem : sort([list,predicate])
predicate :  ordergreatp,orderlessp

? Histograms;

rem : plot see ' intro ' @ begin
rem :  wx before scatterplot, needed to put graph inside the document.

principle : submatrix  (to show specific plot on the canvas)
=================================================
syntax : submatrix(row,Matrix ,column)

p9:p3;

example 1: remove second column 'p9'
----------------------------------------------------------

p9a:submatrix(p9,2);

example 2: only hold matrix over 'p9'
                       7   12
                       8   13
------------------------------------------------------

p9b:submatrix(1,4,5,p9,1);

'-------------------------------------------------------------------------------------------------------------------'