NPlot::ImagePlot Class Reference

Encapsulates functionality for plotting data as a 2D image chart. More...

Inheritance diagram for NPlot::ImagePlot:

NPlot::IPlot NPlot::IDrawable List of all members.

Public Member Functions

 ImagePlot (double[,] data, double xStart, double xStep, double yStart, double yStep)
 Constructor.
 ImagePlot (double[,] data)
 Constructor.
void Draw (Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis)
 Draw on to the supplied graphics surface against the supplied axes.
void DrawInLegend (Graphics g, Rectangle startEnd)
 Draws a representation of this plot in the legend.
Axis SuggestXAxis ()
 Returns an x-axis that is suitable for drawing this plot.
Axis SuggestYAxis ()
 Returns a y-axis that is suitable for drawing this plot.
void WriteData (System.Text.StringBuilder sb, RectangleD region, bool onlyInRegion)
 Write data associated with the plot as text.

Properties

IGradient Gradient
 The gradient that specifies the mapping between value and color.
IGradient gradient_
string Label
 A label to associate with the plot - used in the legend.
string label_ = ""
bool Center
 If true, pixels are centered on their respective coordinates.
bool center_ = true
bool ShowInLegend
 Whether or not to include an entry for this plot in the legend if it exists.
bool showInLegend_ = true

Private Member Functions

void calculateMinMax ()
 Calculates the minimum and maximum values of the data array.

Private Attributes

double[,] data_
double xStart_ = 0.0
double xStep_ = 1.0
double yStart_ = 0.0
double yStep_ = 1.0
double dataMin_
double dataMax_

Detailed Description

Encapsulates functionality for plotting data as a 2D image chart.

Definition at line 62 of file ImagePlot.cs.


Constructor & Destructor Documentation

NPlot::ImagePlot::ImagePlot double  data[,],
double  xStart,
double  xStep,
double  yStart,
double  yStep
[inline]
 

Constructor.

Parameters:
data the 2D array to plot
xStart the world value corresponding to the 1st position in the x-direction
xStep the world step size between pixels in the x-direction.
yStart the world value corresponding to the 1st position in the y-direction
yStep the world step size between pixels in the y-direction.
no adapters for this yet - when we get some more 2d plotting functionality, then perhaps create some.

Definition at line 106 of file ImagePlot.cs.

NPlot::ImagePlot::ImagePlot double  data[,]  )  [inline]
 

Constructor.

Parameters:
data The 2D array to plot.

Definition at line 129 of file ImagePlot.cs.


Member Function Documentation

void NPlot::ImagePlot::calculateMinMax  )  [inline, private]
 

Calculates the minimum and maximum values of the data array.

Definition at line 75 of file ImagePlot.cs.

References data_, dataMax_, and dataMin_.

void NPlot::ImagePlot::Draw Graphics  g,
PhysicalAxis  xAxis,
PhysicalAxis  yAxis
[inline]
 

Draw on to the supplied graphics surface against the supplied axes.

Parameters:
g The graphics surface on which to draw.
xAxis The X-Axis to draw against.
yAxis The Y-Axis to draw against.
TODO: block positions may be off by a pixel or so. maybe. Re-think calculations

Implements NPlot::IDrawable.

Definition at line 143 of file ImagePlot.cs.

References NPlot::PhysicalAxis::Axis, NPlot::PhysicalAxis::PhysicalMax, NPlot::PhysicalAxis::PhysicalMin, NPlot::Axis::WorldMax, NPlot::Axis::WorldMin, and NPlot::PhysicalAxis::WorldToPhysical().

void NPlot::ImagePlot::DrawInLegend Graphics  g,
Rectangle  startEnd
[inline]
 

Draws a representation of this plot in the legend.

Parameters:
g The graphics surface on which to draw.
startEnd A rectangle specifying the bounds of the area in the legend set aside for drawing.

Implements NPlot::IPlot.

Definition at line 235 of file ImagePlot.cs.

Axis NPlot::ImagePlot::SuggestXAxis  )  [inline]
 

Returns an x-axis that is suitable for drawing this plot.

Returns:
A suitable x-axis.

Implements NPlot::IPlot.

Definition at line 262 of file ImagePlot.cs.

Axis NPlot::ImagePlot::SuggestYAxis  )  [inline]
 

Returns a y-axis that is suitable for drawing this plot.

Returns:
A suitable y-axis.

Implements NPlot::IPlot.

Definition at line 277 of file ImagePlot.cs.

void NPlot::ImagePlot::WriteData System.Text.StringBuilder  sb,
RectangleD  region,
bool  onlyInRegion
[inline]
 

Write data associated with the plot as text.

Parameters:
sb the string builder to write to.
region Only write out data in this region if onlyInRegion is true.
onlyInRegion If true, only data in region is written, else all data is written.
TODO: not implemented.

Implements NPlot::IPlot.

Definition at line 330 of file ImagePlot.cs.


Member Data Documentation

double [,] NPlot::ImagePlot::data_ [private]
 

Definition at line 64 of file ImagePlot.cs.

Referenced by calculateMinMax().

double NPlot::ImagePlot::dataMax_ [private]
 

Definition at line 70 of file ImagePlot.cs.

Referenced by calculateMinMax().

double NPlot::ImagePlot::dataMin_ [private]
 

Definition at line 69 of file ImagePlot.cs.

Referenced by calculateMinMax().

double NPlot::ImagePlot::xStart_ = 0.0 [private]
 

Definition at line 65 of file ImagePlot.cs.

double NPlot::ImagePlot::xStep_ = 1.0 [private]
 

Definition at line 66 of file ImagePlot.cs.

double NPlot::ImagePlot::yStart_ = 0.0 [private]
 

Definition at line 67 of file ImagePlot.cs.

double NPlot::ImagePlot::yStep_ = 1.0 [private]
 

Definition at line 68 of file ImagePlot.cs.


Property Documentation

bool NPlot::ImagePlot::Center [get, set]
 

If true, pixels are centered on their respective coordinates.

If false, they are drawn between their coordinates and the coordinates of the the next point in each direction.

Definition at line 293 of file ImagePlot.cs.

bool NPlot::ImagePlot::center_ = true [private]
 

Definition at line 303 of file ImagePlot.cs.

IGradient NPlot::ImagePlot::Gradient [get, set]
 

The gradient that specifies the mapping between value and color.

memory allocation in get may be inefficient.

Definition at line 212 of file ImagePlot.cs.

IGradient NPlot::ImagePlot::gradient_ [private]
 

Definition at line 227 of file ImagePlot.cs.

string NPlot::ImagePlot::Label [get, set]
 

A label to associate with the plot - used in the legend.

Implements NPlot::IPlot.

Definition at line 245 of file ImagePlot.cs.

string NPlot::ImagePlot::label_ = "" [private]
 

Definition at line 255 of file ImagePlot.cs.

bool NPlot::ImagePlot::ShowInLegend [get, set]
 

Whether or not to include an entry for this plot in the legend if it exists.

Implements NPlot::IPlot.

Definition at line 310 of file ImagePlot.cs.

bool NPlot::ImagePlot::showInLegend_ = true [private]
 

Definition at line 320 of file ImagePlot.cs.


The documentation for this class was generated from the following file:
Generated on Sat Nov 5 01:04:08 2005 for NPlot by  doxygen 1.4.5