Ignore:
Timestamp:
Sep 24, 2013, 4:38:54 PM (11 years ago)
Author:
gah
Message:

sync with trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/examples/zoo/curve/curve.tcl

    r1283 r3956  
    33# ======================================================================
    44#  AUTHOR:  Michael McLennan, Purdue University
    5 #  Copyright (c) 2004-2005  Purdue Research Foundation
     5#  Copyright (c) 2004-2012  HUBzero Foundation, LLC
    66#
    77#  See the file "license.terms" for information on usage and
     
    4444        "Frequency of the input source."
    4545    $driver put output.curve(multi$factor).xaxis.units "Hz"
    46     $driver put output.curve(multi$factor).xaxis.scale "log"
     46    #$driver put output.curve(multi$factor).xaxis.scale "log"
    4747    $driver put output.curve(multi$factor).yaxis.label "Current"
    4848    $driver put output.curve(multi$factor).yaxis.description \
     
    7575}
    7676
     77# generate a bar curve
     78$driver put output.curve(bars).about.label "Bar chart"
     79$driver put output.curve(bars).about.description \
     80    "This is an example of a scatter curve."
     81$driver put output.curve(bars).about.type "bar"
     82$driver put output.curve(bars).xaxis.label "Time"
     83$driver put output.curve(bars).xaxis.description "Time during the experiment."
     84$driver put output.curve(bars).xaxis.units "s"
     85$driver put output.curve(bars).yaxis.label "Voltage v(11)"
     86$driver put output.curve(bars).yaxis.description "Output from the amplifier."
     87$driver put output.curve(bars).yaxis.units "V"
     88
     89for {set x 0} {$x < $npts} {incr x} {
     90    set y [expr {sin($x)/(1+$x)}]
     91    $driver put -append yes output.curve(bars).component.xy "$x $y\n"
     92}
     93
     94# generate mixed curves on the same plot
     95set deg2rad 0.017453292519943295
     96
     97$driver put output.curve(line).about.group "Mixed element types"
     98$driver put output.curve(line).about.label "Sine"
     99$driver put output.curve(line).about.description \
     100    "This is an example of a mixed curves on the same plot."
     101$driver put output.curve(line).xaxis.label "Degrees"
     102#$driver put output.curve(line).yaxis.label "Sine"
     103$driver put output.curve(line).about.type "line"
     104for {set x 0} {$x <= 360} {incr x 30} {
     105    set y [expr {sin($x*$deg2rad)}]
     106    $driver put -append yes output.curve(line).component.xy "$x $y\n"
     107}
     108
     109$driver put output.curve(bar).about.group "Mixed element types"
     110$driver put output.curve(bar).about.label "Cosine"
     111$driver put output.curve(bar).about.description \
     112    "This is an example of a mixed curves on the same plot."
     113$driver put output.curve(bar).xaxis.label "Degrees"
     114#$driver put output.curve(bar).yaxis.label "Cosine"
     115$driver put output.curve(bar).about.type "bar"
     116$driver put output.curve(bar).about.style "-barwidth 24.0"
     117
     118for {set x 0} {$x <= 360} {incr x 30} {
     119    set y [expr {cos($x*$deg2rad)}]
     120    $driver put -append yes output.curve(bar).component.xy "$x $y\n"
     121}
     122
     123$driver put output.curve(point).about.group "Mixed element types"
     124$driver put output.curve(point).about.label "Random"
     125$driver put output.curve(point).about.description \
     126    "This is an example of a mixed curves on the same plot."
     127$driver put output.curve(point).xaxis.label "Degrees"
     128#$driver put output.curve(point).yaxis.label "Random"
     129$driver put output.curve(point).about.type "scatter"
     130for {set x 0} {$x <= 360} {incr x 10} {
     131    set y [expr {(rand() * 2.0) - 1}]
     132    $driver put -append yes output.curve(point).component.xy "$x $y\n"
     133}
     134
    77135# save the updated XML describing the run...
    78136Rappture::result $driver
Note: See TracChangeset for help on using the changeset viewer.