for example, choosing tick marks and printing labels is itself a major task to do well. the advantage there is that it separates the axes from the data - if you try to do everything as you print a line, the different tasks become mixed up.īut plotting soon becomes more complex than you expected. the next simplest approach is to make a 2d array of characters (the size of your screen), initially filled with spaces, and then "plot" to that once done you can print it by reading the characters row by row and printing them. Otherwise, if you don't want to use a library, things get complicated quite quickly. then you can just print each line with a length proportional to the y (now x) value (with a * at the end, or all *s for a histogram): +-> y If you want something quick and dirty, the easiest approach by far is to plot the graph sideways (not as bad as it sounds if you are going to print to paper). *READ IN 1 INTEGER (MAXIMUM VALUE OF 100) FOR # OF POINTS IN FILEġ11 PRINT *, 'The Program Has Now Ended' *END IF FOR IF FILE ALREADY EXISTS AMD OPEN IF DID NOT EXIST, PRINT *,'PLEASE ENTER A NAME FOR AN OUTPUT FILE W/ EXTENSION' PRINT *,'FILE DOES NOT EXIST, PLEASE TRY AGAIN' IF(INNAME.EQ.'Q'.OR.INNAME.EQ.'QUIT')THEN PRINT *,'PLEASE INPUT A FILE NAME INCLUDING AN EXTENSION' Listed below is the code that i have so far and a sample input file how would i go about printing a '*' for points as a dirty graph? im not looking for the entire answer just some direction of how to form the algorithm for the write. i want to graph them so that the scale of the x axis is xmax-xmin/#of points and the y axis is the same. I then have the program bubble sort the x values from smallest to greatest. every line after that has an x value then a space then the corresponding y values. in the input file the first entry is the amount of points. I have the program receive plots from an input file. I am trying to create a fortran program that will plot X,Y coordinates to the screen.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |