Liking cljdoc? Tell your friends :D

bytemap.plot


plotclj/s

(plot canvas
      f
      &
      {:keys [axis x-scale y-scale] :or {axis true x-scale 1 y-scale 1}})

Plots a mathematical function on a canvas.

Arguments:

  • canvas: A canvas
  • f: Function to plot (takes a number, returns a number)

Options:

  • :axis - Whether to draw x and y axes (default: true)
  • :x-scale: The range of x values (from -x-scale to +x-scale) (default: 1)
  • :y-scale: The range of y values (from -y-scale to +y-scale) (default: 1)

The function is sampled at regular intervals across the canvas width, and consecutive points are connected with lines.

Returns the new canvas.

Plots a mathematical function on a canvas.

Arguments:
- canvas: A canvas
- f: Function to plot (takes a number, returns a number)

Options:
- :axis - Whether to draw x and y axes (default: true)
- :x-scale: The range of x values (from -x-scale to +x-scale) (default: 1)
- :y-scale: The range of y values (from -y-scale to +y-scale) (default: 1)

The function is sampled at regular intervals across the canvas width,
and consecutive points are connected with lines.

Returns the new canvas.
sourceraw docstring

plot->stringclj/s

(plot->string f [w h] x-scale y-scale & {:keys [axis] :or {axis true}})

Convenience function that plots a mathematical function and returns the string representation.

Arguments:

  • f: Function to plot (takes a number, returns a number)
  • [w h]: schema/Canvas dimensions in pixels
  • x-scale: The range of x values (from -x-scale to +x-scale)
  • y-scale: The range of y values (from -y-scale to +y-scale)

Options:

  • :axis - Whether to draw x and y axes (default: true)
Convenience function that plots a mathematical function and returns the string representation.

Arguments:
- f: Function to plot (takes a number, returns a number)
- [w h]: schema/Canvas dimensions in pixels
- x-scale: The range of x values (from -x-scale to +x-scale)
- y-scale: The range of y values (from -y-scale to +y-scale)

Options:
- :axis - Whether to draw x and y axes (default: true)
sourceraw docstring

(print-plot! f [w h] x-scale y-scale & {:keys [axis] :or {axis true}})

Convenience function that plots a mathematical function on a new canvas and prints it.

Arguments:

  • f: Function to plot (takes a number, returns a number)
  • [w h]: schema/Canvas dimensions in pixels
  • x-scale: The range of x values (from -x-scale to +x-scale)
  • y-scale: The range of y values (from -y-scale to +y-scale)

Options:

  • :axis - Whether to draw x and y axes (default: true)
Convenience function that plots a mathematical function on a new canvas and prints it.

Arguments:
- f: Function to plot (takes a number, returns a number)
- [w h]: schema/Canvas dimensions in pixels
- x-scale: The range of x values (from -x-scale to +x-scale)
- y-scale: The range of y values (from -y-scale to +y-scale)

Options:
- :axis - Whether to draw x and y axes (default: true)
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close