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
10namespace Isis {
18 PlotWindow(title, PlotCurve::CubeDN,
19 PlotCurve::Percentage, parent) {
20 //m_plot->enableAxis(QwtPlot::yRight);
21 QwtText frequencyLabel(QString("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}
This is the (qwt) plot item for a histogram.
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.
QwtPlot * plot()
Get the plot encapsulated by this PlotWindow.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16