Sha256: 83af3bedabcd955cd6b613ad013e3a251b74765a5a53150e2f7ad48b3ce0df07

Contents?: true

Size: 748 Bytes

Versions: 19

Compression:

Stored size: 748 Bytes

Contents

# encoding: ascii-8bit

# Copyright 2014 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

require 'cosmos'
require 'cosmos/gui/qt_tool'
require 'cosmos/gui/line_graph/line_graph_dialog'

def plot(x, y1, y2 = nil)
  Qt.execute_in_main_thread do
    a = Cosmos::LineGraphDialog.new('Graph')
    a.line_graph.add_line('Data 1', y1, x, nil, nil, nil, nil, 'red')
    if y2
      a.line_graph.add_line('Data 2', y2, x, nil, nil, nil, nil, 'blue')
    end
    a.raise
    a.exec
    a.dispose
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cosmos-3.6.3 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.6.2 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.6.1 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.6.0 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.5.3 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.5.2 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.5.0 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.4.2 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.4.1 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.4.0 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.3.3 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.3.2 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.3.1 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.3.0 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.2.1 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.2.0 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.1.2 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.1.1 lib/cosmos/gui/line_graph/line_graph_script.rb
cosmos-3.1.0 lib/cosmos/gui/line_graph/line_graph_script.rb