Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -0,0 +1,4 @@
|
|||
(use '(incanter core stats charts))
|
||||
(def x (range 0 10))
|
||||
(def y '(2.7 2.8 31.4 38.1 58.0 76.2 100.5 130.0 149.3 180.0))
|
||||
(view (xy-plot x y))
|
||||
28
Task/Plot-coordinate-pairs/Python/plot-coordinate-pairs-2.py
Normal file
28
Task/Plot-coordinate-pairs/Python/plot-coordinate-pairs-2.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from visual import *
|
||||
from visual.graph import *
|
||||
|
||||
plot1 = gdisplay( title='VPython Plot-Demo',
|
||||
xtitle='x',
|
||||
ytitle='y (click and drag mouse to see coordinates)',
|
||||
foreground=color.black,
|
||||
background=color.white,
|
||||
x=0, y=0,
|
||||
width=400, height=400,
|
||||
xmin=0, xmax=10,
|
||||
ymin=0, ymax=200 )
|
||||
|
||||
f1 = gdots(color=color.red) # create plot-object
|
||||
|
||||
f1.plot(pos= (0, 2.7), color=color.blue ) # add a single point
|
||||
f1.plot(pos=[(1, 2.8), # add a list of points
|
||||
(2, 31.4),
|
||||
(3, 38.1),
|
||||
(4, 58.0),
|
||||
(5, 76.2),
|
||||
(6, 100.5),
|
||||
(7, 130.0),
|
||||
(8, 149.3),
|
||||
(9, 180.0) ]
|
||||
)
|
||||
label(display=plot1.display, text="Look here",
|
||||
pos=(6,100.5), xoffset=30,yoffset=-20 )
|
||||
|
|
@ -10,7 +10,7 @@ object PlotCoordPairs extends scala.swing.SimpleSwingApplication {
|
|||
|
||||
val (prefSizeX, prefSizeY) = (720, 480)
|
||||
|
||||
lazy val ui = new Panel {
|
||||
private def ui = new Panel {
|
||||
|
||||
import math._
|
||||
val xmax = {
|
||||
|
|
@ -103,5 +103,4 @@ object PlotCoordPairs extends scala.swing.SimpleSwingApplication {
|
|||
title = "Rosetta Code >>> Task: Plot coordinate pairs | Language: Scala"
|
||||
contents = ui
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue