plotting

# plotting - Two and Three-Dimensional Plotting Outline:...

This preview shows pages 1–8. Sign up to view the full content.

Two and Three-Dimensional Plotting Outline: Introduction to Classes A Class for Plotting Data for Plotting Annotations Multiple Data Sets and Legends 2D Plotting Function plotxy()

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction to Classes #include <stdio.h> struct tag1 { int (*fp)(int d); int i; }; int func(int d) { return 2*d; } int main() { struct tag1 s; int d; s.fp = func; d = s.fp(5); printf("d = %d\n", d); return 0; } The structure on the right has a member fp of a pointer to function
#include <stdio.h> struct tag2 { int func(int d); int i; }; int tag2::func(int d) { return 2*d; } int main() { struct tag2 s; int d; d = s.func(5); printf("d = %d\n", d); return 0; } In C++, structures can have members of function. For struct tag2 , member field func is a member of function

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
#include <stdio.h> class tag3 { public: int func(int d); int i; }; int tag3::func(int d) { return 2*d; } int main() { class tag3 c; int d; d = c.func(5); printf("d = %d\n", d); return 0; } A simple class. By default, members of structure are public and members of class are private. The class tag3 is the same as struct tag2 semantically.
A Class for Plotting Plots can be generated from data arrays or files. They can be displayed on a screen, saved in a large number of different file formats, or sent to the stdout stream in png or gif file format for display in a web browser through a web server. A plotting class CPlot enables high-level creation and manipulation of plots. Below is a list of member functions for class CPlot .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Function Description CPlot() Class constructor. Creates and initializes a new instance of the class. ~CPlot() Class destructor. Frees memory associated with a instance of the class. arrow() Add an arrow to a plot. autoScale() Enable or disable autoscaling of plot axes. axis() Enable or disable drawing of x-y axis on 2D plots. axisRange() Set the range for a plot axis. border() Enable or disable drawing of a border around the plot. borderOffsets() Set plot offsets of the plot border. origin() Set the location of the origin for the bounding box of the plot. changeViewAngle() Change the view angles for a 3D plot. circle() Add a circle to a 2D plot. contourLabel() Enable or disable contour labes for 3D surface plots. contourMode() Set the contour display mode for 3D surface plots. coordSystem() Set the coordinate system for a 3D plot. data2D() Add one or more 2D data sets to an instance of the CPlot class. data3D() Add one or more 3D data sets to an instance of the CPlot class. dataFile() Add a data file to an instance of the CPlot class. ...
Function Description ... deletePlots() Remove any data from a previously used instance of the CPlot class. dimension() Set plot dimension to 2D or 3D. displayTime()

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## plotting - Two and Three-Dimensional Plotting Outline:...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online