Mantid Examples: Simple1D and contour plotting
From MantidProject
Contents |
Setup
- Copy the GEM data file to the c:\MantidInstall\Data directory.
Loading a workspace
- Start MantidPlot
- On the Mantid workspaces toolbox click the Load button and select Load Raw File
- In the Load Raw File window click the browse button next to the filename entry
- Find an load the GEM file you just copied. It should be in c:\MantidInstall\Data
- Click OK on the Load Raw File Window.
- When that completes the Mantid Workspaces toolbox should contain a workspace called GEM38370
Displaying the data in a grid
- Right click on the workspace GEM38370 and then select "Show Data".
- In the Set Histogram Range window you should set the from field to 200 (this will exclude the monitors).
- A workspace window (blue) will appear this includes tabs for the data values, counts and bin boundary values for the workspace.
Creating a contour plot
- Click on the workspace window to select it and then click the 3D plot menu
- Select Contour and colour fill.
- A contour plot of the data should appear.
- The magnifiying glass icons in the toolbars allow you to zoom in and out of the plot.
Running a rebin algorithm
- Click in the box next to the execute button in the Mantid Algorithms toolbox.
- Type "rebin" (without the quotes) and hit enter
- A properties box for the rebin algorithm should appear.
- Enter the following:
- InputWorkspace - GEM38370
- OutputWorkspace - MyWorkspace
- param - 0,200,20000
- Click OK
- When that completes you will have another workspace in the Workspaces toolbox called MyWorkspace
Creating a 1D plot
- Create a workspace window for your new workspace as before (in the section "Displaying the data in a grid"), you can also just double click the workspace if you want to save time.
- In you MyWorkspace window left click on one of the grey row labels to select the row
- Right click on the same row to bring up the context menu.
- Choose Plot spectra (values only)
- A 1D plot of the data from that spectra should appear
It is also possible to script all of the above actions using Python. Help with this can be found at Learning_Python along with this example as a pre-written script.
