RubyData

GSoC 2019 Project [ Rubyplot ] discussion

[RUBYPLOT-GSOC][DAILY][3 July] Multi plots

Planned progress
Implement grouped box plot

Progress

  • Since the front end of grouped box plot is not implemented, leaving it for now and focusing on other plots

  • Passed tests for stacked and multi stacked bar plot, outputs:


  • Corrected the y inversion of subplots for Magick backend

  • Added opacity as 0.5 to bubble plot by using drawing circles instead of markers, had to change the front end of bubble plot

  • Changed front end of Circle object to replace border_opacity with fill_opacity

  • Introduced a nominal factor for draw_circle in Magick backend to match the sizes of GR backend

Problems

  • Stacked bar plot lacks legend box
  • GR backend does not implement opacity for draw_circle function

Plans

  • Complete blogs
  • Implement ticks
  • Make a list of plots with examples and problems in them

[RUBYPLOT-GSOC][DAILY][4 July] Ticks

Planned progress
Implement grouped box plot

Progress

  • Looked into the working of ticks

Problems

  • GR backend does not use the input properties and creates ticks in its own way, will discuss this in weekly meeting with @v0dro

Plans

  • Complete blogs
  • Implement ticks
  • Create a list of plots

The bubble plot images

GR:

Magick:

[RUBYPLOT-GSOC][DAILY][5 July] Library review

Planned progress
Checking subplots

Progress

Magick:


  • Added the default value for marker_fill_color for scatter plot in the frontend
  • Added the flag for square axes in the axes frontend
  • Implemented square axes for Magick backend
  • Increased the line width for axes for Magick backend so that it looks better (set the width to 5 pixels)
  • Corrected the spacing ratio function for the bar plot
  • Improved plots for Magick backend, the axes are now plotted above the figures

Problems

  • GR backend lacks the square axes

Meeting summary
To-do list:

  1. Complete the blogs
  2. Implement ticks
  3. Write documentation
  4. Check subplots (done)
  5. Submit a proposal for RubyConf USA
  6. Increase the line width for axes in Magick backend (done)
  7. Draw axes above the figures (done)
  8. Implement rectangular axes (done)
  9. Improve the testing script so that tests for both backends are done in one go
  10. Erase the figures which are out of bounds for Magick backend
  11. Look into legend box for all the multi plots
  12. Take x values as inputs for all the multi plots
  13. Look into spacing for candle stick plot (done) -> @v0dro the spacing is there but it is not that visible if the figure is too big
  14. Create optimized show function such that if write is called just after it then the plotting should not be done again.

Plans

  • Complete blogs
  • Create a list of plots
  • Implement ticks

[RUBYPLOT-GSOC][DAILY][6 July] Saturday

Planned progress
Checking subplots

Progress

  • worked on ticks

Problems

Plans

  • Improve ticks
  • Write blogs
  • Create a list of plots

[RUBYPLOT-GSOC][DAILY][8 July] Show

Planned progress
Implement show function for GR

Progress

  • Focussing on Magick backend and leaving GR backend for now
  • Implemented the show function for Magick backend

Problems

  • The show function is not optimized, I tried optimization by not initialization the figure again but there were some errors which couldn’t be resolved. I will try to resolve the error or find another way for optimization

Plans

  • Optimize the show function
  • Complete the blogs
  • Create a list of plots
  • Implement ticks

[RUBYPLOT-GSOC][DAILY][9 July] Show

Planned progress
Implement show function for GR

Progress

  • Implemented a basic show function for GR backend

Problems

  • If after calling show on a figure, a plot is added to a subplot and then write is called then the figure is not as expected. This happens for both the backends(similar incorrect figure is drawn)
  • the device argument is always kept as a file, which indicates saving the figure. Another option is window which is for displaying the figure. This argument can be removed, I will look into this soon.

Plans

  • solve the bug for consecutive show and write calling
  • complete the blogs
  • Create a list of plots
  • implement ticks

I have booked my visa appointment and I need to travel to Bombay for it and hence I will not be able to work on 11th, 12th and 13th. I will cover for this by working extra after returning.

Did you try using a variable to indicate change of state as we had discussed over the call?

Yes, I did try it but it had some issues related to calling the init_output_device and stop_output_device functions. I will explain the issues in more detail in today’s call.

I couldn’t work on 10th and 11th July due to my visa application and appointment.

[RUBYPLOT-GSOC][DAILY][12 July] Show

Planned progress
Documentation for show function

Progress

  • Had the weekly meeting with @v0dro
  • Improved the show function
  • Tested with different combinations of the show and write and changing the plots in between

Problems

  • Suppose I call the write/show function and then add a plot in a subplot without initializing, it doesn’t work. But if it is initialized again, it works. So, it is necessary to initialize again after calling the write/show function.
    The same thing happens with matplotlib, initialization is necessary. @v0dro
  • GR backend does not wait at the show function, suppose I call it two times, it shows the first time for a very short amount of time and then the second one for longer, is there any way to stop it at a show function and allow the user to keep it displaying for however long the user wants and then when a command is given then the code is executed further, @v0dro could you help me with this?

Meeting summary
Summary and To-do list:

  • Discussed optimizing the show function without having to save the is_initialized state variable
  • Discussed the device argument

Plans

  • complete the blogs
  • Create a list of plots
  • implement ticks

[RUBYPLOT-GSOC][DAILY][13 July] Plot

Planned progress
Working on the plot function

Progress

  • Looked into the plot function frontend
  • Corrected the tests for plot function, changed the unit of the input of sin and cosine from radians to degrees

Problems

  • The backend of the plot function uses Line2D(draw_lines) and draw_markers which are already implemented for Magick except for the line types and some marker types.
  • The plot function currently either plots lines or markers, but ideally, it should do both (if specified)
  • For the format of fmt argument, the string format should be decided, options are keeping it short like matplotlib or having full strings
  • There should be different options for marker_fill_color and marker_border_color and line colour
  • Magick backend can not plot a figure having size 400 cms

Plans

  • Complete the blogs
  • Create a list of plots
  • Implement remaining marker and line types
  • Work on Plot
  • Implement ticks

Yes. Use initialization for now.

Hmmm I’m not too familiar with this part of the GR backend. However I do remember that Pranav had tried to do something similar with GR. Here’s the script that he made: https://github.com/pgtgrly/GRruby-extension/blob/master/examples/GRFramework/Example.rb#L54

I haven’t used this script in a long time but as far as I remember, it does work.

Yes. This should depend on the format string provided by the user.

I’d prefer both. Ruby symbols with full names or strings with shortcuts like in Python.

Just throw an error.

Also, finish the blogs faster.

sure

gets doesn’t work, it waits for some time (I think this is GR default) and then gives this error:
Failures:

  1. Rubyplot::Axes b: #Rubyplot::Backend::GRWrapper:0x00005572753e6150. #plot! plots a simple plot with plus marker of green color
    Failure/Error: hold = gets

    Errno::ENOENT:
    No such file or directory @ rb_sysopen - --t=focus
    /# ./lib/rubyplot/backend/gr_wrapper.rb:350:in ‘gets’
    /# ./lib/rubyplot/backend/gr_wrapper.rb:350:in ‘gets’
    /# ./lib/rubyplot/backend/gr_wrapper.rb:350:in ‘stop_output_device’
    /# ./lib/rubyplot/artist/figure.rb:116:in ‘show’
    /# ./spec/axes_spec.rb:118:in ‘block (3 levels) in <top (required)>’

I will make the necessary changes.

I’ll figure a way for this

okay

Yes, they’ll be done by Wednesday EOD

[RUBYPLOT-GSOC][DAILY][15 July] Plot

Planned progress
Working on Plot function

Progress

  • Worked on format of fmt argument
  • Added error handling of large figures for magick backend

Problems

Plans

  • Complete blogs(Will be done by Wednesday)
  • work on plot function
  • Implement remaining marker and line types
  • Create a list of plots
  • Implement ticks

I was not able to work yesterday (16 July) as I had to make arrangements for my visa appointment (I have been called again for it). I will be having my visa appointment tomorrow(18 July) and hence won’t be able to work today and tomorrow due to traveling. However, I will try to complete the blogs during my travel.
Sorry for the inconvenience @v0dro

Marker type symbols:

dot .
plus +
asterisk *
circle O
diagonal_cross x
solid_circle sO
triangle_up ^
solid_triangle_up s^
triangle_down v
solid_triangle_down sv
square q
solid_square sq
bowtie b
solid_bowtie sb
hglass h
solid_hglass sh
diamond d
solid_diamond sd
star s
solid_star ss
tri_up_down ^v
solid_tri_right s>
solid_tri_left s<
hollow_plus h+
solid_plus s+
pentagon p
hexagon hx
heptagon hp
octagon oc
star_4 s4
star_5 s5
star_6 s6
star_7 s7
star_8 s8
vline |
hline _
omark o

Line type symbols:
solid -
dashed –
dotted -.
dashed_dotted --.
dash_2_dot -…
dash_3_dot -…
long_dash —
long_short_dash
spaced_dash -
-
spaced_dot ._.
double_dot …
triple_dot …

[RUBYPLOT-GSOC][DAILY][19 July] Plot

Planned progress
Working on Plot function

Progress

  • Finished implementing the frontend for the plot function
  • Had a weekly meeting with @v0dro

Problems

Meeting summary
To-do list before 2nd evaluation starts:

  • Implement the plot function frontend (done)
  • Create a list of plots
  • Complete the blogs
  • Implement the remaining marker and line types, as many as possible

Plans

  • Complete the blogs
  • Create a list of plots
  • Implement remaining marker and line types

@v0dro Some of the marker types of matplotlib differ from Rubyplot and hence these are the characters assigned for each marker type, colour and line type:

COLOR_TYPES_FMT = {
          'b' => :blue,
          'g' => :green,
          'r' => :red,
          'c' => :cyan,
          'm' => :magenta,
          'y' => :yellow,
          'k' => :black,
          'w' => :white
    }.freeze

    MARKER_TYPES_FMT = {
      '.' => :dot,
      ',' => :omark,
      'o' => :circle,
      'v' => :traingle_down,
      '^' => :traingle_up,
      '<' => :solid_tri_left,
      '>' => :solid_tri_right,
      '1' => :solid_triangle_down,
      '2' => :solid_triangle_up,
      '3' => :solid_tri_left,
      '4' => :solid_tri_right,
      's' => :square,
      'p' => :pentagon,
      '*' => :star,
      'h' => :hexagon,
      'H' => :heptagon,
      '+' => :plus,
      'x' => :diagonal_cross,
      'D' => :solid_diamond,
      'd' => :diamond,
      '|' => :vline,
      '_' => :hline
    }

    LINE_TYPES_FMT ={
      '--' => :dashed,
      '-.' => :dashed_dotted,
      '-' => :solid,
      ':' => :dotted
    }