Sha256: d3390b8ac9feeee81960b2d027279ddbc7a01f9202d97b84755d53d44ea50777

Contents?: true

Size: 601 Bytes

Versions: 10

Compression:

Stored size: 601 Bytes

Contents

load_library :grafica

include_package 'grafica'

POINTS = 100

def setup
  size(500, 350)
  background(150)

  # Prepare the points for the plot
  points = GPointsArray.new(POINTS)
  
  POINTS.times do |i|
    points.add(i, 10 * noise(0.1 * i))
  end
  
  # Create a new plot and set its position on the screen
  plot = GPlot.new(self)
  plot.set_pos(25, 25)
  
  # Set the plot title and the axis labels
  plot.set_points(points)
  plot.getXAxis.setAxisLabelText("x axis")
  plot.getYAxis.setAxisLabelText("y axis")
  plot.setTitleText("A very simple example")

  # Draw it!
  plot.default_draw
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.6.2 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.6.1 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.6.0 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.5.1 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.5.0 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.4.4 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.4.3 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.4.2 samples/external_library/java_processing/grafica/default_plot.rb
ruby-processing-2.4.1 samples/external_library/java_processing/grafica/default_plot.rb