Skip to content

Commit c39f507

Browse files
committed
update animation docs for YARD
1 parent a24a679 commit c39f507

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

lib/gnuplotrb/animation.rb

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
module GnuplotRB
22
##
3-
# === Overview
43
# Animation allows to create gif animation with given plots
54
# as frames. Possible frames: Plot, Splot, Multiplot.
65
# More about its usage in
76
# {animation notebook}[http://nbviewer.ipython.org/github/dilcom/gnuplotrb/blob/master/notebooks/animated_plots.ipynb].
87
#
9-
# === Options
8+
# == Options
109
# Animations has several specific options:
1110
# * animate - allows to get animated gif's. Possible values are true (just turn on animation),
1211
# ot hash with suboptions (:loop - count of loops, default 0 - infinity$;
@@ -18,6 +17,13 @@ module GnuplotRB
1817
# * font
1918
# * fontscale
2019
# * crop
20+
#
21+
# Animation ignores :term option and does not have methods like #to_png or #to_svg.
22+
# One can also set animation any options related to Plot and they will be considered
23+
# by all nested plots (if they does not override it with their own values).
24+
#
25+
# Animation inherits all plot array handling methods from Multiplot
26+
# and adds aliases for them (#plots -> #frames; #update_frame! -> #update_plot!; etc).
2127
class Animation < Multiplot
2228
##
2329
# *Plot* here is also named as *frame*
@@ -34,16 +40,18 @@ class Animation < Multiplot
3440
alias_method :remove_frame!, :remove_plot!
3541

3642
##
37-
# ====== Overview
3843
# This method creates a gif animation where frames are plots
3944
# already contained by Animation object.
40-
# ====== Arguments
41-
# * *term* - Terminal to plot to
42-
# * *options* - will be considered as 'settable' options of gnuplot
43-
# ('set xrange [1:10]', 'set title 'plot'' etc)
44-
# Options passed here have priority over already existing.
45+
#
46+
# Options passed in #plot have priority over those which were set before.
47+
#
4548
# Inner options of Plots have the highest priority (except
4649
# :term and :output which are ignored).
50+
#
51+
# @param path [String] path to new gif file that will be created as a result
52+
# @param options [Hash] see note about available options in top class documentation
53+
# @return [nil] if path to output file given
54+
# @return [String] gif file contents if no path to output file given
4755
def plot(path = nil, **options)
4856
options[:output] ||= path
4957
plot_options = mix_options(options) do |plot_opts, anim_opts|
@@ -65,7 +73,7 @@ def plot(path = nil, **options)
6573
end
6674

6775
##
68-
# #to_<term_name> methods are not supported by animation
76+
# #to_|term_name| methods are not supported by animation
6977
def to_specific_term(*_)
7078
fail 'Specific terminals are not supported by Animation'
7179
end

0 commit comments

Comments
 (0)