Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/8478_Keep_last_used_colo…
Browse files Browse the repository at this point in the history
…r_map'
  • Loading branch information
OwenArnold committed Nov 22, 2013
2 parents 26086e3 + 95c3445 commit 6f19f05
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 259 deletions.
256 changes: 0 additions & 256 deletions Code/Mantid/Installers/colormaps/_standard.map

This file was deleted.

21 changes: 19 additions & 2 deletions Code/Mantid/MantidPlot/src/Spectrogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,26 @@ void Spectrogram::setGrayScale()

void Spectrogram::setDefaultColorMap()
{
//Use the default (__standard) colormap from MantidColorMap.
mColorMap.setupDefaultMap();
// option 1 use last used colour map
QSettings settings;
settings.beginGroup("Mantid/2DPlotSpectrogram");
//Load Colormap. If the file is invalid the default stored colour map is used
QString lastColormapFile = settings.value("ColormapFile", "").toString();
settings.endGroup();

if (lastColormapFile.size() > 0)
{
mCurrentColorMap = lastColormapFile;
mColorMap.loadMap(lastColormapFile);
}
else
{
//option 2 use the default colormap from MantidColorMap.
mColorMap.setupDefaultMap();
}

setColorMap(mColorMap);

color_map_policy = Default;

QwtPlot *plot = this->plot();
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/scripts/Examples/InstrumentView_Example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

insView = getInstrumentView("LOQTest")

#insView.changeColorMap("../../../repo/Code/Mantid/Installers/colormaps/_standard.map") # Change to the correct path
#insView.changeColorMap("../../../repo/Code/Mantid/Installers/colormaps/Jet.map") # Change to the correct path

insView.setColorMapRange(0.,195)
# Or can set a minimum and maximum separately
Expand Down

0 comments on commit 6f19f05

Please sign in to comment.