Differences

This shows you the differences between two versions of the page.

Link to this comparison view

outputting_publication_quality_plots [2009/09/09 16:11] (current)
johnsoevans created
Line 1: Line 1:
 +====== Publication Quality Plots ======
  
 +
 +There are lots of ways you can output data to produce publication quality plots. ​ We typically use gnuplot (wgnuplot) to do this but you can use excel or any other program. ​ The macros below should give you some ideas:
 +
 +A simple output of obs, calc and difference:
 +
 +<code topas>​macro Rietveld_Plot(filename)
 +{
 +xdd_out filename load out_record out_fmt out_eqn
 +   {
 +       "​ %11.5f ​ " = X;
 +       "​ %11.5f ​ " = Yobs;
 +       "​ %11.5f ​ " = Ycalc;
 +       "​ %11.5f\n"​ = Yobs-Ycalc;
 +   ​} ​
 +}</​code>​
 +
 +Outputting in d-spacing:
 +
 +<code topas>​macro Rietveld_Plot_2th_dspacing(filename)
 +{
 +xdd_out filename load out_record out_fmt out_eqn
 +   {
 +       "​ %11.5f ​ " = Lam/(2 * Sin(X Deg/2));
 +       "​ %11.5f ​ " = Yobs;
 +       "​ %11.5f ​ " = Ycalc;
 +       "​ %11.5f\n"​ = Yobs-Ycalc;
 +   ​} ​
 +}</​code>​
 +
 +The macro below will output tic marks to a file.  The top macro just creates an xy file with points at y = 0, the second lets you specify the y value.
 +
 +<code topas>​macro Rietveld_Tics_2th(filename) { Rietveld_Tics_2th(filename,​0) }
 +macro Rietveld_Tics_2th(filename,​yposn)
 +{
 +      phase_out filename load out_record out_fmt out_eqn ​  {
 +       ​ "​%14.5f"​ = 2* ArcSin(Lam/​(2*D_spacing)) * (360/​(2*Pi)); ​
 +        " %9.2f" ​ = yposn;
 +       ​ "​ %3.0f" = H; 
 +         "​ %3.0f" = K;
 +         "​ %3.0f\n"​ = L;
 +      }  ​
 +}
 +</​code>​

Personal Tools