swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swarm-Support] Re: EZGraph help!


From: Paul Johnson
Subject: [Swarm-Support] Re: EZGraph help!
Date: Thu, 24 Feb 2005 11:01:43 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041127)

Hello!

I'm using Swarm-2.2, perhaps you can see in the documentation if 2.1 is the same.

I just tested the feature to remember window size when a graph is created, and it does work. Here is the example syntax

populationGraph = [EZGraph create: self setTitle: "Population over time" setAxisLabelsX: "time" Y: "population" setWindowGeometryRecordName: "populationGraph" setSaveSizeFlag: YES];

Note the last one "setSaveSizeFlag" is the magic for your case. It does work to save the graph position and size (after you hit the save button on the control panel, of course).

Now, for the problem of saving the screenshot. I do not believe it is possible, or even desirable, to save an EZGraph as a picture. What you should do is save data output into separate files and then use a nice graphic program like R. I've done that, it works fine. You get much better quality graphs that way, and R has easy scripting built in so you can open one dataset after another, make a nice graph for each.

If you insist on making screenshots in Swarm, you have a limited option. There is no feature (that I know of) to save a graph widget into a file. I just tried it in an example and it crashed the program. It is possible, however, to take a screenshot of the whole screen. I am having trouble with this in Fedora Core Linux right now, but I just tested Windows and it does work. I'm looking at sss-2.2 right now, and i'm copying a pit of code that will wrote a picture file showing the whole screen. Note the "nil" value in setWidget is what cause it to take the whole screen.

- writeFrame
{
  char filename[256];
  id aPixmap;
  sprintf(filename, "%04ld.ppm", getCurrentTime());
  aPixmap = [Pixmap createBegin: self];
  [aPixmap setWidget: nil];
  [aPixmap setDecorationsFlag: NO];
  aPixmap = [aPixmap createEnd];
  [aPixmap save: filename];
  [aPixmap drop];
  return self;
}



HU Xiaojun wrote:
hi,Paul

I met a problem, I am wondering if you could give me some help.
It's about the size of EZGraph, how to set it's height and width.

I have, in some cases, 10 or more sequences,( say,20 sequences) for one EZGraph. The legend of those sequences eat most of the space, and the space left for the sequence curves is very small, the graph looks bad, not clear. Of course, the actual size of the EZGraph could be adjusted manually.Adjust the graph to a proper size, take a snap with some tool and save it. It's okay.But I have dozens of those graphs, it's too boring to do this. I want to automatically save the graph. With the pixmap object,the saved image is in origin size (I guess it is 400*250 or so, I prefer 500*300 or larger, in that size, everthing is clear) unless I manually adjust the graph size before simulation.If I adjust the size first, then automatically saved image is in ideal size very clear. But it seems, the swarm could only record the windows' positon, not its size.I don't know how to modify the origin size of EZGraph.It seems doesn't respond to setHeight: Width:) Or, if is it possible to make the swarm record not
only the windows' positon but also the size.

How could I do with it? Could you give me some advice?
I am working with Swarm-2.1.1, windows 2000/swarm-2.2 with windows xp.

best regards

Xiaojun

Tsinghua Univ.
Beijing, P.R.China

2005.2.24



--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700


reply via email to

[Prev in Thread] Current Thread [Next in Thread]