Exemple #1
0
def measureUp():
    stepamplitude=3
    data_power=np.zeros(1000)
    for i in np.arange(0,999):
        data_power[i]=powermeter.getPower()
        stage.up(1, stepamplitude)
        
    plt.plot(data_power)
    plt.show()
    
    #get the index of the maximal power. so we know how many steps to move back to get to the position
    max_index=np.argmax(data_power)
    stage.down(1000-(max_index+1), stepamplitude)   #max_index+1 because of the indexing which starts at 0
Exemple #2
0
# Mayor Library imports
from numpy import linspace, random, pi

# Enthought library imports
from enthought.chaco.shell import plot, hold, title, show


# Create some data
x = linspace(-2*pi, 2*pi, 100)
y1 = random.random(100)
y2 = random.random(100)

# Create some scatter plots
plot(x, y1, "b.")
hold()
plot(x, y2, "g+", marker_size=2)

# Add some titles
title("simple scatter plots")

# This command is only necessary if running from command line
show()

Exemple #3
0
# -*- coding: utf-8 -*-
import numpy as np
import enthought.chaco.shell as cs

x = np.linspace(-2 * np.pi, 2 * np.pi, 100)
y = np.sin(x)

cs.plot(x, y, "r-")
cs.title("First plot")
cs.ytitle("sin(x)")
cs.show()
# -*- coding: utf-8 -*-
import numpy as np
import enthought.chaco.shell as cs 

x = np.linspace(-2*np.pi, 2*np.pi, 100)
y = np.sin(x)

cs.plot(x, y, "r-") 
cs.title("First plot")
cs.ytitle("sin(x)")
cs.show()