mailRe: Development document for adding support for matplotlib graphing to relax.


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on March 27, 2014 - 10:33:
Step 1 is now complete:

http://article.gmane.org/gmane.science.nmr.relax.scm/20298
http://article.gmane.org/gmane.science.nmr.relax.scm/20299

Regards,

Edward



On 27 March 2014 10:28, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:
Hi,

The following is planning document for adding support for matplotlib
graphing to relax.  The plan will be broken into a few simple steps:

1)  Module detection.

Firstly the dep_check module would need to be modified to detect the
presence of the matplotlib Python package.  In addition, the
package_info() method in the 'info' module should be changed to print
out if matplotlib is present and which version is present
(matplotlib.__version__).  Then matplotlib will be shown when running
relax with the --info command line option.


2)  Icons

For the GUI and the user manual, icons are needed.  These can be taken
from the matlplotlib sources and added to the graphics/relax_icons/
directories.  The 16x16, 24x24, 32x32, and 48x48 icons could be taken
from the ./doc/_static/favicon.ico file, specifically layers #4, #5,
and #6.  The 128x128 icon used in the manual could be regenerated
using the matplotlib graphic script ./examples/api/logo2.py, but with
the text removed.


3)  Uf frontend.

For this, the user_functions.grace module can be copied and modified
to change all instances of 'grace' with 'matplotlib'.  So the user
functions would be matplotlib.view and matplotlib.write.  New user
functions could be added later on if additional functionality from
matplotlib is desired.


4)  Uf backend.

The pipe_control.grace module can be copied to pipe_control.matplotlib
and changed as needed.  The key functions are view() and write() as
these are used by the user function frontends.  All other functions
can be added as needed to simplify the matplotlib graph generation
(and the old ones form grace deleted).


5)  Saving format.

Do we output in SVG or PNG?  I don't know matplotlib, but is there a
way of saving a matplotlib native file format so it can be modified
later?  The options should be available as arguments to the
matplotlib.write user function.


Completion of these steps is sufficient for full matplotlib support
within relax.  Then adding the plotting as default for the
auto-analyses would be trivial.

Regards,

Edward



Related Messages


Powered by MHonArc, Updated Thu Mar 27 11:00:15 2014