ruby-numo / numo-gnuplot

Gnuplot wrapper for Ruby/Numo
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link

SVG may take a long time to display in IRuby in a browser #19

Closed kojix2 closed 3 years ago

kojix2 commented 5 years ago

If you try to display a scatter plot of data that contains a large number of samples, the browser may freeze.

Numo.noteplot
  plot SomeBigData
end

In this case, he PNG format may be more appropriate than the SVG format.

Of course, the SVG format is good for displaying small sized data. So there is no best format for every situation.

One solution is to be able to specify the format.

Numo.noteplot
  set :term, :png
  plot SomeBigData
end

Numo.noteplot(format: :png)
  plot SomeBigData
end

Numo::Noteplot.set_format :png

etc...

But I do not know if this is really good.

kojix2 commented 5 years ago

This is a lazy way

Numo.gnuplot
  set :term, :png
  set :output, "hoge.png"
  plot SomeBigData
end
open "hoge.png"
zheng-yongping commented 5 years ago

@kojix2 'pngcairo' may be best terminal type for every situation.

pngcairo: image

png: image

kojix2 commented 3 years ago

This issue is old and will be closed. When I think about it, this is not a problem that should be handled on the numo-narray side. My bad.