xyplotter2: An Aug2020 upgrade
Updated: Aug09,2020

The xyplotter2 can plot text strings read from a table file. From the user's point of view, the only real difference is that what is usually used as the symbol type in the List.* file is now used as the column number to used for the text strings to be plotted. As we are always plotted text strings in the "text" mode, then we no longer need a specific symbol type.



To make the plot: 
  % xyplotter2 List.1 Axes.1 N

Here are the supporting files: 
% cat tab1.parlab
x   X value 
xe  X error 
y   Y value 
ye  Y error 
pn  Point Name 
xoff  Xoffset 
yoff  Yoffset 

% cat tab1.table
# data 
1.0 0.5   1.0  0.5      Hbeta   1.0 3.2
4.0 0.5   5.0  0.5      Dog     4.0 5.5
8.0 0.5   6.0  0.5      Cat     8.0 6.5 

% cat tab2.parlab
x   X value 
xe  X error 
y   Y value 
ye  Y error 
pn  Point Name 
xoff  Xoffset 
yoff  Yoffset 

% cat tab2.table
# data 
6.0 0.4  1.0  0.5      A1    7.0 7.2
5.0 0.7  9.0  0.5      A2    5.5 7.4  

% cat List.1
tab1.table   1 3 2 4   errorbar   b . 1    errorbar
tab1.table   1 3 0 0   point      m o 50   point
tab1.table   1 3 0 0   pointopen  r o 150  pointopen
tab1.table   1 3 0 0   line       g - 1    line 
tab1.table   1 3 6 7   text       k 5 30   text 
tab2.table   1 3 6 7   arrowtext  k 5 10   arrowtext

% cat Axes.1
Sample from xyplotter2 using the new "text" capability
  0.0 10.0   X axis name 
  0.0 10.0   Y value 
 
You can click and drage the files and commands above to reproduce this plot (diplayed in the main section of this cocument).

I put together some notes on my xyplotter routines and they are archived below.



This file began as:   /home/sco/xyplotter_disect/S/README.xyplotter_disect

I make a simple table file:     tab1 

When I run xyplotter_auto, I interactively specifiy that I which columns I 
want to plot. If I specifiy that I want to plot error bars, then it asks me 
the names of the columns I wan to use as error bars. 

tab1.table   1 3   2 4   errorbar   r . 1   PPP
    a        b c   d e      f       g h i    j

  a = name of the table file to use as input 
  b = column number of the X value 
  c = column number of the Y value 
  d = column number of the X error  (usually = 0) 
  e = column number of the Y error  (usually = 0) 
  f = type thing to plot, can be: line, point, pointopen, errorbar
  g = color designation (single letter) 
  h = style of symbol or line type 
  i = size of a symbol (integer) 
  j = name to be used in the symbol legend 

****** Change as of Aug2020 
   When the plot typpe (f) is "text", then the calue 
   of column "h" is the column number in the table file 
   of the text string to be plotted. 

The last thing that xyplotter_auto shows us is the command string that will 
will be used to make the plot. This is the command line for the python coe 
named pxy_SM_plot.py:
    pxy_SM_plot.py STYLE 1.00000 8.00000 1.00000 6.00000 SHOW

After this first run, we have two new files present: Axes.1 List.1
We can change either of these files and rebuild the plot. 

% cat Axes.1
Test
  1.00000 8.00000 X value 
  1.00000 6.00000 Y value 
% cat List.1
tab1.table 1 3 2 4   errorbar   r . 1   PPP

At this stage I could change my files and replot calling only xyplotter. The xyplotter 
file can be called multiple times and will progressively add lines to the List.1 file 
as we add more data sets to be plotted. For now, I just cahnge a few properties and 
plot the same three data points. 

% cat  Axes.1
Here is a second pass at the plot 
  0.0 10.0   X axis name 
  0.0 10.0   Y value 
% cat List.1
tab1.table   1 3 2 4   errorbar   b . 1    PPP
To make my new plot"
% xyplotter List.1 Axes.1 N

Now I want to add a second second set of data. Actually, I'l l 
use the same three points. I just want to plot then as large open circles. 
All I have to do is add a second line to the List.1 file that that specifies 
this new addition: 
% cat List.1
tab1.table   1 3 2 4   errorbar   b . 1    PPP
tab1.table   1 3 0 0   pointopen  r o 100  Line2  

Likewise, to finish out the way we can plot things: 
% cat List.1
tab1.table   1 3 2 4   errorbar   b . 1    Line1
tab1.table   1 3 0 0   pointopen  r o 100  Line2  
tab1.table   1 3 0 0   line       g - 1    Line3  
 
If I run the above code in debug mode I can see the files made for running 
the python code pxy_SM_plot.py:
   % pxy_SM_plot.py STYLE 0.0 10.0 0.0 10.0 SHOW
 
% cat STYLE
Here is a second pass at the plot
X axis name
Y value
XY.plot.1
XY.plot.2
XY.plot.3

% cat XY.plot.1
errorbar b . 1
Line1
  1.0	  0.5	  1.0	  0.5
  4.0	  0.5	  5.0	  0.5
  8.0	  0.5	  6.0	  0.5

% cat XY.plot.2
pointopen r o 100
Line2
  1.0	  1.0
  4.0	  5.0
  8.0	  6.0

% cat XY.plot.3
line g - 1
Line3
  1.0	  1.0
  4.0	  5.0
  8.0	  6.0

The first file (named STYLE) is just setting up the axis labeling and ranges. 
Then it just lists the input file built for each data set. Each data set will 
be plotted in the pxy_SM_plot.py code by the function:   def plot_a_set(infile,verbo)

In this call infile is the name of the file (listed in our STYLE file) and 
verbo is a flag that tells the code to spit out verboze messages if desired. 

Here is a good start 
=========================================================== 
I wrote new version that uses "text" type: pxy_SM_plot2.py

I do this example in:   /home/sco/xyplotter_disect/T1

% cat STYLE
Developing text mode 
X new mod 
Y new mod again 
XY.plot.2
XY.plot.3
XY.plot.4

% cat XY.plot.2
text    b . 40 
Line1
  1.0	  1.0  1.5  1.5   P1	  
  4.0	  5.0  4.0  5.5   T2 
  8.0	  6.0   8.5 2.5   Ng

% cat XY.plot.3
pointopen r o 100
Line2
  1.0	  1.0
  4.0	  5.0
  8.0	  6.0

% cat XY.plot.4
line g - 1
Line3
  1.0	  1.0
  4.0	  5.0
  8.0	  6.0
 
% pxy_SM_plot2.py STYLE 0.0 10.0 0.0 10.0 SHOW
=========================================================== 

Now I make xyplotter2 that will run pxy_SM_plot2.py. 

 



Back