Changes between Version 23 and Version 24 of soc/2007/VisualizationOfContainers


Ignore:
Timestamp:
Jun 27, 2007, 1:38:12 AM (15 years ago)
Author:
jakevoytko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • soc/2007/VisualizationOfContainers

    v23 v24  
    1818{{{
    1919#!cpp
    20 vector<double> data1;
    21 deque<double> data2;
    2220
    23 
    24 svg_plot my_plot("D:\\1D_legend_demo.svg");
     21svg_plot my_plot;
    2522
    2623// size/scale settings
    27 my_plot.image_size(500, 350);
    28 my_plot.x_scale(-2, 10);
     24my_plot.set_image_size(500, 350)
     25       .set_x_scale(-2, 10);
    2926   
    3027// command settings
    31 my_plot.draw_axis()
    32        .show_legend();
     28my_plot.set_axis(true)
     29       .set_legend(true);
    3330
    3431// color settings
     
    4138
    4239// write to file. NOTE: Will change to write(filename) soon
    43 my_plot.write();
     40my_plot.write("D:\\1d_simple.svg");
    4441
    4542}}}
     
    4946[http://www.tcnj.edu/~voytko2/svg.htm]
    5047
    51 == Using Boost.Array ==
     48== Complex example ==
    5249
    53 Because Boost.Array supports an iterator-like interface, (`my_arr.begin()`, `my_arr.end()`), Boost.Array can freely be used with the program
     50Because Boost.Array supports an iterator-like interface, (`my_arr.begin()`, `my_arr.end()`), Boost.Array can freely be used with the program.
    5451
     52{{{
     53#!cpp
     54
     55    vector<double> data1;
     56    deque<double> data2;
     57    boost::array<double, 10> data3;
     58
     59    svg_plot my_plot;
     60
     61    // size/scale settings
     62    my_plot.set_image_size(500, 350)
     63           .set_x_scale(-3, 10);
     64
     65    // Text settings
     66    my_plot.set_title("Oh My!")
     67           .set_title_font_size(29)
     68           .set_x_label_text("Time in Months");
     69
     70    // command settings
     71    my_plot.set_axis(true)
     72           .set_legend(true)
     73           .set_plot_window(true)
     74           .set_x_label(true)
     75           .set_x_major_labels(true);
     76
     77    // color settings
     78    my_plot.set_background_color(svg_color(67, 111, 69))
     79           .set_legend_background_color(svg_color(207, 202,167))
     80           .set_plot_background_color(svg_color(136, 188, 126))
     81           .set_title_color(white)
     82           .set_x_axis_color(black)
     83           .set_x_major_tick_color(black)
     84           .set_legend_border_color(svg_color(102, 102, 84))
     85           .set_x_minor_tick_color(black);
     86
     87    //axis settings
     88    my_plot.set_x_major_tick(2)
     89           .set_x_num_minor_ticks(3)
     90           .set_x_major_tick_length(14)
     91           .set_x_minor_tick_length(7)
     92           .set_x_major_tick_width(1)
     93           .set_x_minor_tick_width(1);
     94
     95    //legend settings
     96    my_plot.set_legend_title_font_size(15);
     97
     98    plot_range(my_plot, data2.begin(), data2.end(), "Lions",  blue);
     99    plot_range(my_plot, data1.begin(), data1.end(), "Tigers", purple);
     100    plot_range(my_plot, data3.begin(), data3.end(), "Bears",  red);
     101
     102    my_plot.write("D:/1d_complex.svg");
     103
     104}}}
    55105= To-Do List =
    56106== For next week ==