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

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

View Full Document Right Arrow Icon
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()
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
#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
Background image of page 3

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

View Full DocumentRight Arrow Icon
#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.
Background image of page 4
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 .
Background image of page 5

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

View Full DocumentRight Arrow Icon
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. ...
Background image of page 6
Function Description ... deletePlots() Remove any data from a previously used instance of the CPlot class. dimension() Set plot dimension to 2D or 3D. displayTime()
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 31

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online