GSoC 2019 Project [ Rubyplot ] discussion


Planned progress
Implement show function for GR


  • Implemented a basic show function for GR backend


  • 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.


  • 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.


Planned progress
Documentation for show function


  • 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


  • 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


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


Planned progress
Working on the plot function


  • 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


  • 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


  • 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:

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.


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

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

    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


Yes, they’ll be done by Wednesday EOD


Planned progress
Working on Plot function


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



  • 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 —
spaced_dash -
spaced_dot ._.
double_dot …
triple_dot …


Planned progress
Working on Plot function


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


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


  • 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:

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

      '.' => :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

      '--' => :dashed,
      '-.' => :dashed_dotted,
      '-' => :solid,
      ':' => :dotted


Planned progress
Working on Plot function


  • worked on blogs



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

[RUBYPLOT-GSOC][DAILY][22 - 26 July] 2nd phase Evaluation

Worked on Code review and the blogs


Planned progress
Writing plot function tests




  • Write tests for fmt argument of the plot function
  • Complete the multi plots blog
  • Look into iruby notebooks

[RUBYPLOT-GSOC][DAILY][29 July] iruby

Planned progress

Looked into iruby notebboks codebase



  • Integrate Rubyplot with iruby notebooks
  • Complete the remaining blog
  • Make a list of polts

I will be unavailable to work from 30th July to 3-4 August due to packing, traveling and shifting to France for my bachelor’s thesis.
I had already included this in my timeline and hence my project won’t be affected.
Sorry for the inconvenience and I will cover up by working extra in the coming weeks.

[RUBYPLOT-GSOC][DAILY][5 August] iruby

Planned Progress
Integrating iruby with Rubyplot

Tried to set up Rubyplot on my laptop but rmagick installation is giving some errors

I will find a solution for the errors and will continue the work


  • Set up Rubyplot
  • Work as planned