[gradsusr] Add regression line to scatter plot

Saunders, Emily (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] emily.saunders at nasa.gov
Tue Oct 1 09:45:17 EDT 2019


Hello all,

I have a question about adding a linear regression line to a scatter plot using the 'sregr' command. Here is a sample of the script I created:

'set lat 54 60'
'set lon -120 -110'
*'define a=o3*1e9'
'define a = ave(o3*1.0e9, time='d_start''timestring', time='d_end''timestring')'
say 'define a = ave(o3*1.0e9, time='d_start''timestring', time='d_end''timestring')'
'set vrange 0 60'
*'define b=pm25_rh35_gcc'
'define b = ave(pm25_rh35_gcc, time='d_start''timestring', time='d_end''timestring')'
say 'define b = ave(pm25_rh35_gcc, time='d_start''timestring', time='d_end''timestring')'
'set vrange 0 1200'
'set gxout scatter'
'set cmark 2'
'set cthick 12'
'set ccolor 9'
    titlepm25gcc = 'Surface_O3_and_PM25_Scatter_plot'
    diagnostic = 'Surface'
    location = 'Alberta'
    type = 'Scatter'
    imagenamepm25gcc = diagnostic'.'location'.NRT.'fieldnamepm25gcc'.scatter_plot.('d_start':'d_end').'MM'.'DD'.'YYYY'.png'
'd b;a'
*'set time 'timestring
*'set lat 54 60'
*'set lon -120 -110'
*'set gxout line'
*'set z 1'
*'set t 1'
*'set cmark 0'
*'set cthick 12'
*'set ccolor 0'
*'set cstyle 0'
*'set line 1 1 5'
*'d sregr(b, a, lon=-120, lon=-110, lat=54, lat=60)'

Thanks for your help in advanced.

Emily Saunders, PhD.
Senior Research Scientist
Global Modeling and Assimilation Office/SSAI
NASA Goddard Space Flight Center Bldg 33, Room B-227B
Code 610.1, Greenbelt, MD, 20771
Phone: +1-301-614-6532

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20191001/51c26602/attachment.html>


More information about the gradsusr mailing list