Skip to content

Commit 0a31463

Browse files
committed
fix issue with missing data in Daru containers
1 parent 460bfa4 commit 0a31463

File tree

1 file changed

+2
-2
lines changed
  • lib/gnuplotrb/external_classes

1 file changed

+2
-2
lines changed

lib/gnuplotrb/external_classes/daru.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class DataFrame
1313
def to_gnuplot_points
1414
result = ''
1515
each_row_with_index do |row, index|
16-
quoted = index.is_a?(String) || index.is_a?(Symbol)
16+
quoted = (index.is_a?(String) || index.is_a?(Symbol)) && index.length > 0
1717
result += quoted ? "\"#{index}\" " : "#{index} "
1818
result += row.to_a.join(' ')
1919
result += "\n"
@@ -32,7 +32,7 @@ class Vector
3232
def to_gnuplot_points
3333
result = ''
3434
each_with_index do |value, index|
35-
quoted = index.is_a?(String) || index.is_a?(Symbol)
35+
quoted = (index.is_a?(String) || index.is_a?(Symbol)) && index.length > 0
3636
result += quoted ? "\"#{index}\" " : "#{index} "
3737
result += "#{value}\n"
3838
end

0 commit comments

Comments
 (0)