Isis 3 Programmer Reference
HistogramPlotWindow.cpp
1 #include "HistogramPlotWindow.h"
2 
3 #include <qwt_scale_engine.h>
4 
5 #include <QDockWidget>
6 
7 #include "Histogram.h"
8 #include "HistogramItem.h"
9 
10 namespace Isis {
18  PlotWindow(title, PlotCurve::CubeDN,
19  PlotCurve::Percentage, parent) {
20  //m_plot->enableAxis(QwtPlot::yRight);
21  QwtText frequencyLabel("Frequency", QwtText::PlainText);
22 
23  frequencyLabel.setColor(Qt::darkCyan);
24  QFont font = frequencyLabel.font();
25  font.setPointSize(13);
26  font.setBold(true);
27  frequencyLabel.setFont(font);
28  plot()->enableAxis(QwtPlot::yRight);
29  plot()->setAxisTitle(QwtPlot::yRight, frequencyLabel);
30 
31  p_dock = new QDockWidget("Histogram Info", this);
32  p_dock->setAllowedAreas(Qt::AllDockWidgetAreas);
33  p_dock->setFloating(false);
34  p_dock->setObjectName("DockWidget");
35  p_dock->setMinimumWidth(130);
36  addDockWidget(Qt::LeftDockWidgetArea, p_dock, Qt::Vertical);
37 
38 // QwtText *rtLabel = new QwtText("Percentage",
39 // QwtText::PlainText);
40 // rtLabel->setColor(Qt::red);
41 // font = rtLabel->font();
42 // font.setPointSize(13);
43 // font.setBold(true);
44 // rtLabel->setFont(font);
45 // m_plot->setAxisTitle(QwtPlot::yRight, *rtLabel);
46 
47 // setAxisLabel(QwtPlot::xBottom, "Pixel Value (DN)");
48 
49 // setScale(QwtPlot::yRight, 0, 100);
50  setPlotBackground(Qt::white);
51  }
52 
53 
61  hi->attach(plot());
62  p_histItems.push_back(hi);
63  plot()->replot();
64  }
65 }
HistogramPlotWindow(QString title, QWidget *parent)
Constructor, creates a new HistogramPlotWindow.
void add(HistogramItem *)
Add a HistogramItem to the plot.
void setPlotBackground(QColor c)
Sets the plot background color to the given color.
Definition: PlotWindow.cpp:289
This is the (qwt) plot item for a histogram.
Definition: HistogramItem.h:24
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QwtPlot * plot()
Get the plot encapsulated by this PlotWindow.