1
1
module GnuplotRB
2
2
##
3
- # === Overview
4
3
# Animation allows to create gif animation with given plots
5
4
# as frames. Possible frames: Plot, Splot, Multiplot.
6
5
# More about its usage in
7
6
# {animation notebook}[http://nbviewer.ipython.org/github/dilcom/gnuplotrb/blob/master/notebooks/animated_plots.ipynb].
8
7
#
9
- # === Options
8
+ # == Options
10
9
# Animations has several specific options:
11
10
# * animate - allows to get animated gif's. Possible values are true (just turn on animation),
12
11
# ot hash with suboptions (:loop - count of loops, default 0 - infinity$;
@@ -18,6 +17,13 @@ module GnuplotRB
18
17
# * font
19
18
# * fontscale
20
19
# * 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).
21
27
class Animation < Multiplot
22
28
##
23
29
# *Plot* here is also named as *frame*
@@ -34,16 +40,18 @@ class Animation < Multiplot
34
40
alias_method :remove_frame! , :remove_plot!
35
41
36
42
##
37
- # ====== Overview
38
43
# This method creates a gif animation where frames are plots
39
44
# 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
+ #
45
48
# Inner options of Plots have the highest priority (except
46
49
# :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
47
55
def plot ( path = nil , **options )
48
56
options [ :output ] ||= path
49
57
plot_options = mix_options ( options ) do |plot_opts , anim_opts |
@@ -65,7 +73,7 @@ def plot(path = nil, **options)
65
73
end
66
74
67
75
##
68
- # #to_< term_name> methods are not supported by animation
76
+ # #to_| term_name| methods are not supported by animation
69
77
def to_specific_term ( *_ )
70
78
fail 'Specific terminals are not supported by Animation'
71
79
end
0 commit comments