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 }
Isis::HistogramPlotWindow::add
virtual void add(CubePlotCurve *pc)
This method adds the curves to the plot.
Definition: PlotWindow.cpp:436
QWidget
Isis::PlotCurve
Definition: PlotCurve.h:44
Isis::HistogramItem
This is the (qwt) plot item for a histogram.
Definition: HistogramItem.h:24
Isis::HistogramPlotWindow::HistogramPlotWindow
HistogramPlotWindow(QString title, QWidget *parent)
Constructor, creates a new HistogramPlotWindow.
Definition: HistogramPlotWindow.cpp:17
Isis::PlotWindow::setPlotBackground
void setPlotBackground(QColor c)
Sets the plot background color to the given color.
Definition: PlotWindow.cpp:289
Isis::PlotWindow::plot
QwtPlot * plot()
Get the plot encapsulated by this PlotWindow.
Definition: PlotWindow.cpp:1653
Isis::PlotWindow
Definition: PlotWindow.h:88
QDockWidget
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16