You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library, of course, supports different output formats. Most of these also produce an accompanying Gnuplot source file, allowing archival and further customization if needed. The current list of formats are:
106
106
107
107
```scala
108
-
output(ASCII, plot(...)) // returns the string as above
109
-
output(SVG, plot(...)) // returns the SVG text, which can be embedded in html or saved as a SVG file
110
-
output(PDF(dir, name), plot(...)) // produces dir/name.gpl as the gnuplot source, and attempts dir/name.pdf
111
-
output(PNG(dir, name), plot(...)) // produces dir/name.gpl as the gnuplot source, and attempts dir/name.png
112
-
output(GUI, plot(...)) // opens a window with the plot, which can be modified/exported/resized/etc.
108
+
output(ASCII, xyChart(...)) // returns the string as above
109
+
output(SVG, xyChart(...)) // returns the SVG text, which can be embedded in html or saved as a SVG file
110
+
output(PDF(dir, name), xyChart(...)) // produces dir/name.gpl as the gnuplot source, and attempts dir/name.pdf
111
+
output(PNG(dir, name), xyChart(...)) // produces dir/name.gpl as the gnuplot source, and attempts dir/name.png
112
+
output(GUI, xyChart(...)) // opens a window with the plot, which can be modified/exported/resized/etc.
113
113
```
114
114
115
115
Note that scalaplot calls the `gnuplot` command to render the image in `dir/name.EXT`, but in case it fails, do the following:
@@ -121,29 +121,29 @@ $ gnuplot name.gpl
121
121
122
122
which will create `name.EXT`, where `EXT` is one of `PDF` or `PNG`.
123
123
124
-
### Plot
124
+
### XYChart
125
125
126
-
The `plot` function is the main entry point for creating charts. The first argument of plot requires a `XYData` object, that we will describe in the next section. The rest of the arguments customize the aspects of the chart that are not data-specific.
126
+
The `xyChart` function is the main entry point for creating charts. The first argument of plot requires a `XYData` object, that we will describe in the next section. The rest of the arguments customize the aspects of the chart that are not data-specific.
127
127
128
128
```scala
129
129
vald:XYData= ...
130
-
plot(d)
131
-
plot(d, "Chart Title!")
132
-
plot(d, x =Axis(label ="Age"), y =Axis(log =true))
130
+
xyChart(d)
131
+
xyChart(d, "Chart Title!")
132
+
xyChart(d, x =Axis(label ="Age"), y =Axis(log =true))
133
133
```
134
134
135
135
Here are the relevant definitions and default parameters that you can override:
136
136
137
137
```scala
138
-
defplot(data: XYData, title: String="",
139
-
x: NumericAxis=newNumericAxis,
140
-
y: NumericAxis=newNumericAxis,
141
-
pointSize: Option[Double] =None,
142
-
legendPosX: LegendPosX.Type=LegendPosX.Right,
143
-
legendPosY: LegendPosY.Type=LegendPosY.Center,
144
-
showLegend: Boolean=false,
145
-
monochrome: Boolean=false,
146
-
size: Option[(Double, Double)] =None):XYChart
138
+
defxyChart(data: XYData, title: String="",
139
+
x: NumericAxis=newNumericAxis,
140
+
y: NumericAxis=newNumericAxis,
141
+
pointSize: Option[Double] =None,
142
+
legendPosX: LegendPosX.Type=LegendPosX.Right,
143
+
legendPosY: LegendPosY.Type=LegendPosY.Center,
144
+
showLegend: Boolean=false,
145
+
monochrome: Boolean=false,
146
+
size: Option[(Double, Double)] =None):XYChart
147
147
defAxis(label: String="",
148
148
backward: Boolean=false,
149
149
log: Boolean=false,
@@ -163,10 +163,10 @@ val y1 = (1 until 100).map(j => math.pow(j, 1))
0 commit comments