Origin Ver. and Service Release: OriginPro 2016 (64-bit) Sr2 b9.3.2.303 (Student Version)
Operating System: Windows 10
I routinely collect data and plot it in origin. I have been learning labtalk to simplify the plotting process.
I would like my plots to look something like this:
The main part Im having trouble with is seting a second x axis and setting the axis labels.
When I open my raw data, it looks like this:
I then run a simple labtalk script to format the data better:
wks.col = 2 ;
wks.insert();
//Rename Column Identifiers;
wks.col1.name$ = AgCl;
wks.col2.name$ = RHE;
wks.col3.name$ = Amp;
//Set column long name;
col(1)[L]$ = Potential;
col(1)[U]$ = V vs Ag/AgCl;
col(2)[L]$ = Potential;
col(2)[U]$ = V vs RHE;
col(3)[L]$ = Current;
col(3)[U]$ = Amp;
//Set col(b) as X2;
wks.col2.type = 4;
//Set col(b) to RHE ADJUST PH VALUE DEPENDING ON EXPERIMENT;
//RHE = Ag/AgCl + 0.1997 + 0.059*pH
col(2) = col(1) + 0.1997 + 0.059*4;
//Add Column for mAmp;
wks.addCol(mAmp);
//set mAmp settings;
col(mAmp)[L]$ = Current;
col(mAmp)[U]$ = mAmp;
col(mAmp) = col(Amp) * 1000;
I want the y axis to have the same label as shown in my first picture. If I edit it directly on the worksheet, I would use the alt code ALT+249 to make the dot operator (∙). however Alt codes do not work in the labtalk scrip editor.
So when I use the first part of my script, my worksheet looks like this:
This is almost what I want except that the Y2 column does not quite have the units that I need
My first question is how do I add italics for the axis labels and how would I use the dot operator so that I can write (j / mAmp ∙ cm^-2) as shown in the first picture.
I then plot this using the second half of my script which is:
//Plotting Data
plotxy iy:=(2,4) plot:=200;
//FIXING PLOT DETAILS;
//Increase axis thickness;
layer.x.thickness = 1.5;
//Make Box Around Figure;
layer.x.opposite = 1;
layer.y.opposite = 1;
//Set Major Tick Length
layer.tickL = 12;
//Set Font Size of Tick Labels
layer.x.label.pt = 24;
layer.y.label.pt = 24;
//Set Font Size of Axis Labels
xb.fsize = 28;
yl.fsize = 28;
//Moving Legend
legend.x=layer.x.to - legend.dx/2;
legend.y=layer.y.to - legend.dy/2;
//Set Linewidth to 1.5 (I dont understand why 750 gives 1.5 but it does);
set %C -w 750;
This gives me the following plot:
My second question is, How do I set the X1 Column (AgCl) as the second x axis at the top of the plot and how do I add an axis label to this second axis?