Multiple Series
We show an examples of multiple series using default and non-default values for the line specifications (color, transparency, type).
The file data.csv
contains colums for time (s),sin(t),cos(2t)
.
::::::::::::::
data.csv
::::::::::::::
time (s),sin(t),cos(2t)
0,0,1
0.1,0.099833417,0.980066578
0.2,0.198669331,0.921060994
0.3,0.295520207,0.825335615
0.4,0.389418342,0.696706709
0.5,0.479425539,0.540302306
0.6,0.564642473,0.362357754
0.7,0.644217687,0.169967143
0.8,0.717356091,-0.029199522
0.9,0.78332691,-0.227202095
1,0.841470985,-0.416146837
1.1,0.89120736,-0.588501117
1.2,0.932039086,-0.737393716
1.3,0.963558185,-0.856888753
1.4,0.98544973,-0.942222341
1.5,0.997494987,-0.989992497
1.6,0.999573603,-0.998294776
1.7,0.99166481,-0.966798193
1.8,0.973847631,-0.896758416
1.9,0.946300088,-0.790967712
2,0.909297427,-0.653643621
2.1,0.863209367,-0.490260821
2.2,0.808496404,-0.30733287
2.3,0.745705212,-0.112152527
2.4,0.675463181,0.087498983
2.5,0.598472144,0.283662185
2.6,0.515501372,0.468516671
2.7,0.42737988,0.634692876
2.8,0.33498815,0.775565879
2.9,0.239249329,0.885519517
3,0.141120008,0.960170287
3.1,0.041580662,0.996542097
3.2,-0.058374143,0.993184919
3.3,-0.157745694,0.950232592
3.4,-0.255541102,0.86939749
3.5,-0.350783228,0.753902254
3.6,-0.442520443,0.608351315
3.7,-0.529836141,0.438547328
3.8,-0.611857891,0.251259843
3.9,-0.687766159,0.053955421
4,-0.756802495,-0.145500034
4.1,-0.818277111,-0.339154861
4.2,-0.871575772,-0.519288654
4.3,-0.916165937,-0.678720047
4.4,-0.951602074,-0.811093014
4.5,-0.977530118,-0.911130262
4.6,-0.993691004,-0.974843621
4.7,-0.999923258,-0.999693042
4.8,-0.996164609,-0.984687856
4.9,-0.982452613,-0.930426272
5,-0.958924275,-0.839071529
5.1,-0.925814682,-0.714265652
5.2,-0.883454656,-0.560984257
5.3,-0.832267442,-0.385338191
5.4,-0.772764488,-0.194329906
5.5,-0.705540326,0.004425698
5.6,-0.631266638,0.203004864
5.7,-0.550685543,0.393490866
5.8,-0.464602179,0.56828963
5.9,-0.373876665,0.720432479
6,-0.279415498,0.843853959
6.1,-0.182162504,0.933633644
6.2,-0.083089403,0.986192302
6.3,0.0168139,0.999434586
To plot this data, we create a yml
input file called
recipe.yml
.
::::::::::::::
recipe.yml
::::::::::::::
sine-data:
type: xymodel
folder: ./ # the current directory
file: data.csv
skip_rows: 1
plot_kwargs:
label: sin(t)
color: darkorange
linestyle: "-"
linewidth: 4
alpha: 0.5
cosine-data:
type: xymodel
folder: ./ # the current directory
file: data.csv
skip_rows: 1
ycolumn: 2
plot_kwargs:
label: cos(2t)
linestyle: "-."
linewidth: 2
figure:
type: xyview
folder: ./ # the current directory
file: recipe.svg
size: [ 8.0, 6.0 ]
title: Example using figio
xlabel: time (s)
ylabel: functions of time f(t)
yaxis_rhs:
scale: 10
label: right-hand-side label with 10 f(t) scale
yticks: [ -10, -5, 0, 5, 10 ]
details: false
display: true
dpi: 100
latex: false
serialize: true
Run figio
on the input file to produce the figure:
figio recipe.yml
Processing file: recipe.yml
====================================
Information
For (x, y) data and time series data:
type: xymodel items associate with type: xyview items.
For histogram data:
type: hmodel items associate with type: hview items.
====================================
Finished XYViewBase constructor.
Creating view with guid = "figure"
Adding all models to current view.
Figure dpi set to 100
Figure size set to [8.0, 6.0] inches.
Serialized view to: recipe.svg
====================================
End of figio execution.
The following figure appears:
Congratulations! You just made a figio
figure with two data sources.