\(\renewcommand\AA{\unicode{x212B}}\)
Colorfill and Contour Plots¶
Other Plot Types
General Plot Help
Colorfill Plots¶
Plot Toolbar¶
![Plot Toolbar Colorfill](../_images/PlotToolbarTiledColorfill.png)
Scripting¶
Click the generate a script button on a Colorfill Plot:
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LogNorm
from matplotlib.ticker import LogLocator
from mantid.api import AnalysisDataService as ADS
MAR11060 = ADS.retrieve('MAR11060')
fig, axes = plt.subplots(figsize=[8.0, 7.0], num='MAR11060-1', subplot_kw={'projection': 'mantid'})
cfill = axes.imshow(MAR11060, aspect='auto', cmap='viridis', distribution=False, origin='lower')
cfill.set_norm(LogNorm(vmin=0.0001, vmax=3792.3352))
# If no ticks appear on the color bar remove the subs argument inside the LogLocator below
cbar = fig.colorbar(cfill, ax=[axes], ticks=LogLocator(subs=np.arange(1, 10)), pad=0.06)
cbar.set_label('Counts ($\\mu s$)$^{-1}$')
axes.set_title('MAR11060')
axes.set_xlabel('Time-of-flight ($\\mu s$)')
axes.set_ylabel('Spectrum')
axes.set_xlim([5.0, 19992.0])
axes.set_ylim([0.5, 922.5])
plt.show()
![../_images/ImageNotFound.png](../_images/ImageNotFound.png)
Enable :plots: using DOCS_PLOTDIRECTIVE in CMake¶
For more advice:
Contour Plots¶
A Contour Plot is essentially a Colorfill Plot with Contour lines overlaid.
Plot Toolbar¶
![Plot Toolbar Contour](../_images/PlotToolbarContour.png)
Change the Color of the Contour lines:
![Color Palette Wireframe and Contour](../_images/ColorPaletteWireframeContour.png)
Click Menus¶
![Click Menus Contour](../_images/PlotClickMenusContour.png)
ptions Menu¶
![Plot Options Colorfill and Contour](../_images/PlotOptionsColorfillContour.png)
Scripting¶
Basic example of plotting a Contour Plot:
![../_images/ImageNotFound.png](../_images/ImageNotFound.png)
Enable :plots: using DOCS_PLOTDIRECTIVE in CMake¶
For more advice:
General¶
General Plot Help
Plots Toolbox¶
![Plot Toolbox](../_images/PlotsWindow.png)
File > Settings¶
![Plot Settings](../_images/PlotSettings.png)
Other Plotting Documentation