Skip to content

Commit 642c25d

Browse files
committed
Update Version 0.0.1
1 parent 3611981 commit 642c25d

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
# VPlotLib
22

3-
Plotting library for V, inspired by `matplotlib`
3+
Plotting library for V, inspired by Python's `matplotlib`
4+
5+
### Quick example:
6+
7+
```v
8+
import vplotlib as vpl
9+
10+
fn main() {
11+
x, x1, y, y1 := ... // inputs
12+
13+
mut fig := vpl.new_figure(title: 'Multiple Plots')
14+
fig.scatter(x, y, mut vpl.PlotOptions{})
15+
fig.line(x1, y1, mut vpl.PlotOptions{})
16+
fig.line(x, y, mut vpl.PlotOptions{ line_color: gx.red, line_type: .dashed })
17+
fig.show()
18+
}
19+
```

examples/hello_plot.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn main() {
2121
mut fig := vpl.new_figure(title: 'Multiple Plots')
2222
fig.scatter(x, y, mut vpl.PlotOptions{})
2323
fig.line(x1, y1, mut vpl.PlotOptions{})
24-
fig.line(x, y, mut vpl.PlotOptions{ line_color: gx.red, line_type: .dashed})
24+
fig.line(x, y, mut vpl.PlotOptions{ line_color: gx.red, line_type: .dashed })
2525
fig.show()
2626

2727
vpl.l_info('MAIN END')

src/plot.v

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ fn frame(fig &Figure) {
4848
h := fig.g_po.height * (1 - 2 * fig.g_po.axis_pad_y)
4949
fig.ctx.draw_rect_empty(x_c, y_c, w, h, gx.black)
5050

51+
// fig.ctx.draw_text_def(int(x_c + w / 2), int(y_c/2), fig.g_po.title)
52+
5153
for plot in fig.plots {
5254
plot.draw(fig.ctx, fig.g_po)
5355
}
5456
fig.ctx.end()
5557
}
5658

57-
fn on_resize (e &gg.Event, mut fig Figure){
59+
fn on_resize(e &gg.Event, mut fig Figure) {
5860
fig.g_po.width = e.window_width
5961
fig.g_po.height = e.window_height
60-
}
62+
}

src/vplotlib.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module vplotlib
33
import time
44

55
pub const (
6-
version = '0.0.0'
6+
version = '0.0.1'
77
)
88

99
pub fn l_info(s string) {

0 commit comments

Comments
 (0)