RubyData

GSoC 2019 Project [ Rubyplot ] discussion

[RUBYPLOT-GSOC][DAILY][28 June] Evaluation

Planned progress
Complete Evaluation

Progress

Problems

  • I will apply for my visa soon and the appointment for it will be on Tuesday or Wednesday and hence I will be unavailable to work for 2-3 days during that time.

Plans

  • Complete the blogs
  • Implement ticks

[RUBYPLOT-GSOC][DAILY][29 June] Starting multiple plots

Planned progress
Check multi bar plot

Progress

  • Worked on blog
  • Wrote an experimental test for multi bar plot and the output is correct
    data given =
[["Data1", [4, 7, 12], :blue],
 ["Data2", [2, 6, 10], :yellow],
 ["Data3", [3, 8, 11], :red],
 ["Data4", [1, 5, 9], :black]]

Output for GR backend:

Output for Magick backend:

  • Corrected the function for the input of spacing_ratio in bar plot

Problems

  • I will complete the blog in 1-2 days
  • What is the purpose of the stacked_bar plot? is it different than a simple bar plot? @v0dro
  • I saw that there is a test for dot plot but there is no such plot, should dot plot be added? @v0dro
  • Matplotlib allows the user to set the x coordinates, whereas in Rubyplot it is decided by us, should there be an option to take the x values as an input? @v0dro
  • Bar plot does not create legend box (or it is not visible)

Plans

  • Complete the blogs
  • Implement ticks
  • Check multi box plot

[RUBYPLOT-GSOC][DAILY][30 June] Sunday

Planned progress
Check multi box plot

Progress

  • Worked on blogs

Problems

  • Will check the multi box plot in addition to next day’s work.

Plans

  • Complete the blogs
  • Implement ticks
  • Check multi box plot
  • Check multi candle-stick plot

[RUBYPLOT-GSOC][DAILY][1 July] Issues

Planned progress
check multi candle stick plot

Progress

Problems

  • Could not work today due to some personal issues and visa application

Plans

  • Complete the remaining work

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

Planned progress
Check multi stacked bar plot

Progress

  • Checked and passed tests for multi box plot, outputs:
    boxplot3
    boxplot4
  • Corrected multi candle stick plot, the bug was that it was plotting one candle stick less
  • Checked and passed tests for multi candle stick plot, output:
    candlestick2

Problems

  • Both candle stick and box plot lack legend box
  • Single box plot, candle stick plot, etc. utilise multi plots and hence I will include this in the blog as well, due to which the blog will take some time
  • Both candle stick plot and box plot do not take x values as inputs, but matplotlib has the necessary condition of giving x values as input, should this be incorporated here as well? @v0dro
  • I had not checked stacked bar plot earlier, and hence will check that first and then move to multi stacked bar plot

Plans

  • Work on blogs
  • Check stacked bar plot and multi stacked bar plot
  • Implement ticks

[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