StringToPng v1

../_images/StringToPng-v1_dlg.png

StringToPng dialog.

Summary

Creates an image file containing a string.

Properties

Name Direction Type Default Description
String Input string Mandatory String to plot
OutputFilename Input string Mandatory Name of the image file to savefile. Allowed values: [‘png’]

Description

Saves a string as a png file, as part of autoreduction.

Note

Requires matplotlib.

Usage

#write to a file
try:
    import mantid
    filename=mantid.config.getString("defaultsave.directory")+"StringToPngTest.png"
    StringToPng("This is a string\nAnd this is a second line",OutputFilename=filename)
except:
    pass

Output:

The file should look like

StringToPngTest.png

Categories: Algorithms | DataHandling\Plots

Source

Python: StringToPng.py (last modified: 2018-01-09)