Plot -.-

I dont know how to use plot funciton
can some1 please give me a tutorial with plot (a large explanation) if is possible ?
There is no "plot" function, so you'll have to elaborate.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
int inputFile()
{
    int choice2, file;

    cout<<endl<<"\t**You Have Selected To Read From A File**\n"<<endl;
    cout<<"Please Choose From The Following:";
    cout<<"\n--------------------------------"<<endl;
    cout<<"1. Enter a file name: "<<endl;
    cout<<"2. Select file from a list"<<endl;
    cout<<"3. Return To Main Menu"<<endl;
    cout<<endl<<"Make A Selection From The Menu: ";
    cin>>choice2;


    if(file==1)
    {
        int i, j, x, y;

        char plot[21][75] = {'.'};
        plot[x][y]='+';
        for(i=20; i>-1; i--)
        {
            for(j=0; j<75; j++)
            {
                plot[i][j]='.';
                plot[x][y]='+';

                cout<<plot[i][j];
            }
            cout<<"\n";
        }
    }
    return EXIT_SUCCESS;
}


AM I UNDESTOOT ???
Last edited on
another eg. of plot is :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <math.h>
#include <chplot.h>
#define NUM 36
    int main() 
{
        double x[NUM], y[NUM];
        class CPlot plot;
        int i;
        for(i=0; i<NUM; i++) 
       {
          x[i] = i*360/(NUM-1); // assign x with values from 0 to 360 linearly
          y[i] =  sin(x[i]*M_PI/180);
       }   
        plot.title("Ch plot");
        plot.label(PLOT_AXIS_X, "xlabel");
        plot.label(PLOT_AXIS_Y, "ylabel");
        plot.data2DCurve(x, y, NUM);
        plot.plotting();
}


Last edited on
Athar, i think i gave you all the clues, to know what i am talking about, can you now help me ?? (the codes up here arent mine (other sites and forums i seeked because i cant find help here !?!))
Just google for chplot or chplot.h - here's the first result http://www.softintegration.com/docs/ch/plot/

Well. By looking at that example I can figure something out about the class CPlot... (oh, and relax please).
1
2
3
4
CPlot::title(/*Title of your plot*/);
CPlot::label(/*Indication of which label to change*/,/*the new value of the label*/);
CPlot::data2DCurve(/*Data for the x value of the points*/,/*Data for the y value of the points*/,/*Number of points*/);
CPlot::plotting(); //Plots your stuff. 


Does this help a bit?

EDIT: Check Null's link too. See if that helps.

-Albatross
Last edited on
WoW this is really helpfull, thanks ;D (both of you) ;D
Last edited on
yeah still have 1 question, what should i use to compile this codes ... ? (OpenGl, ... or what? )
I'm not sure what Ch's dependencies are, but I'm getting the feeling that you can just use the Ch interpreter to run these codes.

http://www.softintegration.com/products/chstandard/

-Albatross
Last edited on
Topic archived. No new replies allowed.