8000 Merge pull request #10 from icm7216/fix-to-iruby · ruby-numo/numo-gnuplot@80846cb · GitHub
[go: up one dir, main page]

10000 Skip to content

Commit 80846cb

Browse files
authored
Merge pull request #10 from icm7216/fix-to-iruby
Fix not display on IRuby notebook
2 parents 9872644 + 86c0f7a commit 80846cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/numo/gnuplot.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def initialize(&block)
3737

3838
def to_iruby
3939
require 'tempfile'
40-
tempfile_svg = Tempfile.open('plot')
40+
tempfile_svg = Tempfile.open(['plot','.svg'])
4141
# output SVG to tmpfile
4242
gp = Gnuplot.default
4343
gp.reset
4444
gp.set terminal:'svg'
45-
gp.output:tempfile_svg.path
4645
gp.instance_eval(&@block)
46+
gp.output tempfile_svg.path
4747
gp.unset 'output'
4848
svg = File.read(tempfile_svg.path)
4949
tempfile_svg.close

0 commit comments

Comments
 (0)
0