Changes between Version 27 and Version 28 of soc/2007/VisualizationOfContainers


Ignore:
Timestamp:
Jul 3, 2007, 1:42:57 AM (15 years ago)
Author:
jakevoytko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • soc/2007/VisualizationOfContainers

    v27 v28  
    1 = 0. Introduction =
     1= Introduction =
    22This project is focused on using STL containers in order to graph data on a one-dimensional and two-dimensional (and if time allows, 3D!) plot. The plot would be written in an `svg` image, compliant with the W3C standard. The goals of the project are as follows:
    33
     
    106106Produces the following file: [http://www.tcnj.edu/~voytko2/svg_complex.htm]
    107107
     108== Simple 2D Example ==
     109
     110=== Note: Because one of this week's tasks is to make sane defaults, the sample program here will likely be shorter ===
     111
     112{{{
     113#!cpp
     114    multimap<double, double> data;
     115
     116    svg_2d_plot my_plot;
     117
     118    for(double i=0; i<10; ++i)
     119    {
     120        data.insert(std::pair<double,double>(i,f(i)));
     121    }
     122
     123    // size/scale settings
     124    my_plot.set_image_size(500, 350)
     125           .set_x_scale(-1, 10)
     126           .set_y_scale(-1, 5);
     127
     128    // Text settings
     129    my_plot.set_title("2D Graph Test")
     130           .set_title_font_size(29);
     131
     132    // command settings
     133    my_plot.set_axis(true)
     134           .set_legend(true)
     135           .set_plot_window(true)
     136           .set_x_major_labels(true)
     137           .set_y_major_labels(true);
     138
     139    // color settings
     140      my_plot.set_background_color(darkgray)
     141             .set_legend_background_color(white)
     142             .set_plot_background_color(white);
     143
     144    //axis settings
     145    my_plot.set_x_major_tick(2)
     146           .set_x_num_minor_ticks(1)
     147           .set_x_major_tick_length(14)
     148           .set_x_minor_tick_length(7)
     149           .set_x_major_tick_width(2)
     150           .set_x_minor_tick_width(1)
     151
     152           .set_y_major_tick(2)
     153           .set_y_num_minor_ticks(1)
     154           .set_y_major_tick_length(20)
     155           .set_y_minor_tick_length(10)
     156           .set_y_major_tick_width(2)
     157           .set_y_minor_tick_width(1);
     158
     159    //legend settings
     160    my_plot.set_legend_title_font_size(15);
     161
     162    plot_range(my_plot, data.begin(), data.end(), "sqrt(x)",  black);
     163
     164    my_plot.write("D:/test.svg");
     165}}}
     166
     167Produces the following file: [http://www.tcnj.edu/~voytko2/svg_2d.htm]
     168
    108169= To-Do List =
    109170== For next week ==
    110  * Begin to re-support 2D plots
    111  * Have more complete documentation
    112  * Have at least minimal regression testing up and running
    113 
    114 == By July 2nd ==
    115  * Expand workings of program to two dimensions
    116 
    117 = 3. Suggestions  =
     171 * Better/more complete Documentation
     172 * Fewer bugs
     173 * As many suggestions finished as I can
     174
     175= Suggestions  =
    118176''By Matias Capeletto:''
    119177 * Be able to choose a log scale for either the X or the Y axis