Skip to content

Commit

Permalink
re #8791 some basic plotting improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
NickDraper committed Jan 30, 2014
1 parent 11ec9b4 commit b6fdc59
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 12 deletions.
58 changes: 47 additions & 11 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Expand Up @@ -793,11 +793,11 @@ void ApplicationWindow::initGlobalConstants()
d_show_table_comments = false;

titleOn = true;
// 'Factory' default is to show top & right axes but without labels
d_show_axes = QVector<bool> (QwtPlot::axisCnt, true);
// 'Factory' default is to not show top & right axes
d_show_axes[1] = false;
d_show_axes[3] = false;
d_show_axes_labels = QVector<bool> (QwtPlot::axisCnt, true);
d_show_axes_labels[1] = false;
d_show_axes_labels[3] = false;
canvasFrameWidth = 0;
defaultPlotMargin = 0;
drawBackbones = true;
Expand All @@ -809,7 +809,7 @@ void ApplicationWindow::initGlobalConstants()
autoscale2DPlots = true;
autoScaleFonts = true;
autoResizeLayers = true;
antialiasing2DPlots = false; //Mantid
antialiasing2DPlots = true;
fixedAspectRatio2DPlots = false; //Mantid
d_scale_plots_on_print = false;
d_print_cropmarks = false;
Expand All @@ -819,15 +819,15 @@ void ApplicationWindow::initGlobalConstants()
defaultCurveLineWidth = 1;
defaultSymbolSize = 7;

majTicksStyle = static_cast<int>(ScaleDraw::Out);
minTicksStyle = static_cast<int>(ScaleDraw::Out);
majTicksStyle = static_cast<int>(ScaleDraw::In);
minTicksStyle = static_cast<int>(ScaleDraw::In);
minTicksLength = 5;
majTicksLength = 9;

legendFrameStyle = static_cast<int>(LegendWidget::Line);
legendTextColor = Qt::black;
legendBackground = Qt::white;
legendBackground.setAlpha(0); // transparent by default;
legendBackground.setAlpha(255); // opaque by default;

defaultArrowLineWidth = 1;
defaultArrowColor = Qt::black;
Expand Down Expand Up @@ -5126,7 +5126,42 @@ void ApplicationWindow::readSettings()
/* --------------- end group Tables ------------------------ */

/* --------------- group 2D Plots ----------------------------- */

settings.beginGroup("/2DPlots");

// Transform from the old setting for plot defaults, will only happen once.
if ( !settings.contains("/UpdateForPlotImprovements1") )
{
settings.beginGroup("/General");
settings.writeEntry("/UpdateForPlotImprovements1","true");
settings.writeEntry("/Antialiasing","true");

//enable right and top axes without labels
settings.beginWriteArray("EnabledAxes");
int i=1;
settings.setArrayIndex(i);
settings.writeEntry("enabled", "true");
settings.writeEntry("labels", "false");
i=3;
settings.setArrayIndex(i);
settings.writeEntry("enabled", "true");
settings.writeEntry("labels", "false");
settings.endArray();
settings.endGroup();

//ticks should be in
settings.beginGroup("/Ticks");
settings.writeEntry("/MajTicksStyle", ScaleDraw::In);
settings.writeEntry("/MinTicksStyle", ScaleDraw::In);
settings.endGroup();

//legend to opaque
settings.beginGroup("/Legend");
settings.writeEntry("/Transparency", 255);
settings.endGroup(); // Legend

}

settings.beginGroup("/General");
titleOn = settings.value("/Title", true).toBool();
canvasFrameWidth = settings.value("/CanvasFrameWidth", 0).toInt();
Expand All @@ -5140,6 +5175,7 @@ void ApplicationWindow::readSettings()
autoscale2DPlots = settings.value("/Autoscale", true).toBool();
autoScaleFonts = settings.value("/AutoScaleFonts", true).toBool();
autoResizeLayers = settings.value("/AutoResizeLayers", true).toBool();

antialiasing2DPlots = settings.value("/Antialiasing", false).toBool(); //Mantid
fixedAspectRatio2DPlots = settings.value("/FixedAspectRatio2DPlots", false).toBool(); //Mantid
d_scale_plots_on_print = settings.value("/ScaleLayersOnPrint", false).toBool();
Expand Down Expand Up @@ -5178,15 +5214,15 @@ void ApplicationWindow::readSettings()
settings.endGroup(); // General

settings.beginGroup("/Curves");
defaultCurveStyle = settings.value("/Style", Graph::Line).toInt();
defaultCurveStyle = settings.value("/Style", Graph::LineSymbols).toInt();
defaultCurveLineWidth = settings.value("/LineWidth", 1).toDouble();
defaultSymbolSize = settings.value("/SymbolSize", 7).toInt();
defaultSymbolSize = settings.value("/SymbolSize", 3).toInt();
applyCurveStyleToMantid = settings.value("/ApplyMantid", true).toBool();
settings.endGroup(); // Curves

settings.beginGroup("/Ticks");
majTicksStyle = settings.value("/MajTicksStyle", ScaleDraw::Out).toInt();
minTicksStyle = settings.value("/MinTicksStyle", ScaleDraw::Out).toInt();
majTicksStyle = settings.value("/MajTicksStyle", ScaleDraw::In).toInt();
minTicksStyle = settings.value("/MinTicksStyle", ScaleDraw::In).toInt();
minTicksLength = settings.value("/MinTicksLength", 5).toInt();
majTicksLength = settings.value("/MajTicksLength", 9).toInt();
settings.endGroup(); // Ticks
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/Graph.cpp
Expand Up @@ -139,7 +139,7 @@ Graph::Graph(int x, int y, int width, int height, QWidget* parent, Qt::WFlags f)
ignoreResize = false;
drawAxesBackbone = true;
autoScaleFonts = false;
d_antialiasing = false;
d_antialiasing = true;
d_scale_on_print = true;
d_print_cropmarks = false;
d_synchronize_scales = false;
Expand Down

0 comments on commit b6fdc59

Please sign in to comment.