Class: Numo::Gnuplot::RgbImageData
- Defined in:
- lib/numo/gnuplot.rb
Instance Method Summary collapse
- #check_shape ⇒ Object
-
#initialize(data) ⇒ RgbImageData
constructor
:nodoc: all.
Methods inherited from ImageData
Methods inherited from PlotData
array_shape, #cmd_str, #data_format, #data_str, #line_str
Constructor Details
#initialize(data) ⇒ RgbImageData
:nodoc: all
1015 1016 1017 1018 1019 1020 1021 |
# File 'lib/numo/gnuplot.rb', line 1015 def initialize(data) if data.kind_of?(Numo::NArray) super(data) else super(Numo::NArray[*data]) end end |
Instance Method Details
#check_shape ⇒ Object
1023 1024 1025 1026 1027 1028 1029 1030 1031 |
# File 'lib/numo/gnuplot.rb', line 1023 def check_shape if @data.shape.size != 3 raise IndexError,"array should be 2-dimensional" end if @data.shape[2] != 3 raise IndexError,"shape[2] (last dimension size) must be 3" end @shape = @data.shape end |