Changeset 6661 for trunk/examples
- Timestamp:
- Dec 9, 2016, 10:44:46 AM (8 years ago)
- Location:
- trunk/examples/zoo/curve
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/zoo/curve/curve.py
r5681 r6661 39 39 # single['component.xy'] = [x, y] 40 40 # single['component.xy'] = np.row_stack((x, y)) 41 42 # generate a single curve with x and y axis upper and lower limits 43 xminl = xmin+((xmax-xmin)/4.0) 44 xmaxl = xmax-((xmax-xmin)/4.0) 45 yminl = np.cos(xminl)/(1+xminl) 46 ymaxl = np.cos(xmaxl)/(1+xmaxl) 47 limited = rx['output.curve(limited)'] 48 limited['about.label'] = "Axis limits curve" 49 limited['about.description'] = \ 50 'This is an example of a single curve with x and y axis limits applied.' 51 limited['xaxis.label'] = "Time" 52 limited['xaxis.description'] = "Time during the experiment." 53 limited['xaxis.units'] = "s" 54 limited['xaxis.min'] = xminl 55 limited['xaxis.max'] = xmaxl 56 limited['yaxis.label'] = "Voltage v(11)" 57 limited['yaxis.description'] = "Output from the amplifier." 58 limited['yaxis.units'] = "V" 59 limited['yaxis.min'] = yminl 60 limited['yaxis.max'] = ymaxl 61 62 # plot it 63 limited['component.xy'] = (x, y) 64 41 65 42 66 # generate multiple curves on the same plot -
trunk/examples/zoo/curve/curve.tcl
r3911 r6661 33 33 $driver put -append yes output.curve(single).component.xy "$x $y\n" 34 34 } 35 36 # generate a single curve with x and y axis upper and lower limits 37 set xminl [expr $min+(($max-$min)/4.0)] 38 set xmaxl [expr $max-(($max-$min)/4.0)] 39 set yminl [expr {cos($xminl)/(1+$xminl)}] 40 set ymaxl [expr {cos($xmaxl)/(1+$xmaxl)}] 41 42 $driver put output.curve(limited).about.label "Axis limits curve" 43 $driver put output.curve(limited).about.description \ 44 "This is an example of a single curve with x and y axis limits applied." 45 $driver put output.curve(limited).xaxis.label "Time" 46 $driver put output.curve(limited).xaxis.description "Time during the experiment." 47 $driver put output.curve(limited).xaxis.units "s" 48 $driver put output.curve(limited).xaxis.min $xminl 49 $driver put output.curve(limited).xaxis.max $xmaxl 50 $driver put output.curve(limited).yaxis.label "Voltage v(11)" 51 $driver put output.curve(limited).yaxis.description "Output from the amplifier." 52 $driver put output.curve(limited).yaxis.units "V" 53 $driver put output.curve(limited).yaxis.min $yminl 54 $driver put output.curve(limited).yaxis.max $ymaxl 55 56 for {set x $min} {$x < $max} {set x [expr {$x+$dx}]} { 57 set y [expr {cos($x)/(1+$x)}] 58 $driver put -append yes output.curve(limited).component.xy "$x $y\n" 59 } 60 35 61 36 62 # generate multiple curves on the same plot
Note: See TracChangeset
for help on using the changeset viewer.