Displaying/Generating Graphs In E-Prime

Cynthia J. DeVore devo0023 at tc.umn.edu
Wed Sep 18 15:46:22 UTC 2002


Steve,

So far as I know, there isn't a readily available method for generating graphs.
I have, however, developed something that performs a similar function. The
"trick" is to reorient the Canvas space because down is up (positive number
increase in the y-direction moving from top to bottom, rather than from bottom
to top as we typically see in coordinate space).

The code below is the core of the logic used to draw a histogram in which the
low value is 3 and the high value is 18. (In this task, 3 dice are rolled and
the sum is graphed.) XConst is the width of each bar. xbase is the location of
the leftmost portion of the graph. ybase is the bottom of the graph (with the
labels beneath this "bottom"). DiceTotalArray is an array that holds the
frequency for each dice roll (3 to 18).

For i = 3 to 18
     OffScreenCnvs.Text xbase+(i*XConst), ybase, i
     OffScreenCnvs.Text xbase+(i*XConst), ybase+20, DiceTotalArray(i)
     ' draw a rectangle or a line
     if DiceTotalArray(i) > 0 then
         OffScreenCnvs.Rectangle xbase+(i*XConst),
ybase-(DiceTotalArray(i)*YConst), XConst, DiceTotalArray(i)*YConst
     end if
Next i

' draw a line for "zero"
OffScreenCnvs.Line xbase+(3*XConst), ybase, xbase+(19*XConst), ybase

If you want the whole program to pull apart, I'll send it to you.

Cynthia

Cynthia DeVore
I/O Grad Student and E-Prime Consultant
University of Minnesota, Minneapolis
devo0023 at tc.umn.edu
612-624-3601

Steve Lacey wrote:

> Hi,
>
> I am writing a script for a basic CRT experiment. After every block of
> trials I want to provide feedback in the form of graphs. There will be
> several graphs--one will plot RT by block number, another that will plot
> accuracy by block number, ect.
>
> Any ideas about how I might do this? Is there a method within e-prime to do
> this? Could I send the data to Excel, generate the plots there, and then
> import them back into separate images in a slide object? If either of these
> are possible, how would I do it?
>
> Thanks,
> Steve



More information about the Eprime mailing list