Re: PtPlot

2003-06-19 Thread Christopher Hylands
> Hi - I thought I would check in again.  Been a while since I flooded your
> inbox with questions.  First, is this the best way to get support for
> PtPlot?  Are there any UseNet groups or other mailing lists?  I don't want
> to put all of this on you.  

[EMAIL PROTECTED] goes to Professor Lee and I.
I'm the primary support provider for Ptplot.
Posting to the ptolemy-hackers mailing list also goes to both of us
and to 250 people on the mailing list and to the comp.soft-sys.ptolemy
mailing list.
See http://ptolemy.eecs.berkeley.edu/mailinglists.htm
for information on how to subscribe to the mailing list
If you post just to the newsgroup, I'll eventually see the message and
handle it.



> To refresh you, I am developing a Swing Application for OS X on Java
> 1.4.1.  The application plots data or many different types from a number
> of dataloggers.  Overall, things are going very well with using PtPlot.  I
> have some pretty cool graphs that are being added to nested JSplitPanes,
> then stuck into JInternalFrames.  I have a couple of questions though. 
> Perhaps I could get your feedback.  Questions are listed in order or
> importance to my work.  
> 
> 1. Is there are way to select different plot configurations for different
> traces?  For example, I would like some traces on my plot to be shown with
> symbols (setMarksStyle("various") and some to be shown with no symbols
> (setMarksStyle("none")).  Is this possible?  It seems like you can only
> call setMarksStyle for the whole plot, not an individual trace.

Plot contains a method called
setMarksStyle(String style, int dataset)
that will do what you want.

In PlotML, I think you can use a marks= attribute like:


I have not tried that lately though.

> 2.  I am getting some slow rendering when working with plots with > 5000
> points in each trace.  Do you know of any limitations to the number of
> points a plot will reasonably hold and render?

We have run into similar issues.  Steve Neuendorffer said:
> Several things would help:
> 1) Using java2d transforms effectively to reduce the amount of math
> done during painting.
> 2) refactoring the plotting routines so that the rescaling
> computations are only done once in the beginning.
> 3) Double buffering the plot so that the drawing only gets done once.
> This should happen by default in the windowing system, but for some reason
> its not.
>
> Another thing that will specifically help Edward is to update to 
> jdk1.4.1_02 and turn off the noddraw=true flag in the ptinvoke script.

Steve made some changes to PlotBox that should improve offscreen buffer
support.  These changes are present in the Ptplot classes shipped with
Ptolemy II 3.0beta, but they are not present in Ptplot5.2.  We
will create a new Ptplot release eventually.
Ptolemy II 3.0beta can be found at
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/index.htm

Someone else suggested increasing the amount of RAM on the machine.

Ptplot could do better here.  My guess is that the problem is
PlotPoint, which has the following fields.


/** True if this point is connected to the previous point by a line. */
public boolean connected = false;

/** True if the yLowEB and yHighEB fields are valid. */
public boolean errorBar = false;

/** Original value of x before wrapping. */
public double originalx;

/** X value after wrapping (if any). */
public double x;

/** Y value. */
public double y;

/** Error bar Y low value. */
public double yLowEB;

/** Error bar Y low value. */
public double yHighEB;

We could try reducing the number of fields somehow.


> 3. This is a big one.  I desperately need to plot data of different
> types on the same plot.  For example, I want to plot temperature and
> relative-humidity data on the same plot, have them scale appropriately
> so the y-range of both takes up the same vertical space on the screen,
> and have separate y-axes for each trace.  Any thought on how to do
> that?  I have considered two options: 1) normalize everything to -1 to
> 1, and plot that.  Then draw fake axes on the outside.  Dealing with
> the axes would be quite difficult when it comes to zooming though.  2)
> Draw plots on top of one another, with the background being
> transparent.  Here, I would need to figure out how to see one
> particular y-axes.. any simpler way to go about this?

We don't support two y-axes.  We don't have plans to do this,
though people have asked about it over the years.  The reason we don't
have plans is that Professor Lee and I have other tasks ahead of us,
and we have not needed two y-axes yet.   

The axis labeling code is very tricky.  Anyone can write code that
will label axes, but this code has lots of tricks in it to label the
axes well, without overlapping numbers etc.

So, delegating this task to someone else would be tricky, because they
are likely to not quite do the right thing.  

It would be a nice feature though.

How I would do it would be to

Re: Ptplot colors

2001-04-25 Thread Christopher Hylands

"Page Stites" <[EMAIL PROTECTED]>
I am trying to figure out how ptplot (when running as an applet) =
determines the sequence of colors that it chooses for overlaying =
different datasets on the same set of plot axes.  I have found that the =
sequence of colors depends on the machine where the java source was =
compiled -- is this consistent with anyone else's experience?  If there =
is some algorithm that ptplot uses to determine this sequence of colors, =
I would like to find out more about it so that I may apply the same =
algorithm to my code.

In Ptplot5.1, the colors are in an array and used in order.

PlotBox.java contains:

// Default _colors, by data set.
// There are 11 colors so that combined with the
// 10 marks of the Plot class, we can distinguish 110
// distinct data sets.
static protected Color[] _colors = {
new Color(0xff),   // red
new Color(0xff),   // blue
new Color(0x00),   // cyan-ish
new Color(0x00),   // black
new Color(0xffa500),   // orange
new Color(0x53868b),   // cadetblue4
new Color(0xff7f50),   // coral
new Color(0x45ab1f),   // dark green-ish
new Color(0x90422d),   // sienna-ish
new Color(0xa0a0a0),   // grey-ish
new Color(0x14ff14),   // green-ish
};

PlotBox._drawLegend() contains:

if (_usecolor) {
// Points are only distinguished up to the number of colors
int color = dataset % _colors.length;
graphics.setColor(_colors[color]);
}
_drawPoint(graphics, dataset, urx-3, ypos-3, false);


Plot._drawPlotPoint() contains:

// Set the color
if (_usecolor) {
int color = dataset % _colors.length;
graphics.setColor(_colors[color]);
} else {
graphics.setColor(_foreground);
}


By having 11 colors and 10 point types, we can have 110 different data
sets.

Ptplot3.1 has a similar array.  I'm not sure how the order could be
dependent on the compiler.  There must be something else at work,
perhaps.

-Christopher


Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Re: PtPlot question

2002-04-29 Thread cxh

> From: Marco Antoniotti <[EMAIL PROTECTED]>
> Subject: PtPlot question
> Date: 29 Apr 2002 13:07:31 -0400
> 
> 
> Hi
> 
> I am using PtPlot to display "regions" where a given condition is
> satisfied.
> 
> E.g. suppose I am displaying sin(x) and cos(x) over an interval and I
> figure out where
> 
> sin(x) < cos(x)
> 
> I would like to have some way to tell PtPlot to change the background
> color from a given `x' onward.  How difficult is this to achieve?
> 
> Of course, then you have the problem of dealing with "intersection" of
> regions etc etc

It probably would not be that hard, you could look at the code that
draws the bounding boxes for the zoom facility  PlotBox._zoomBox()
would be a place to start.  You could create a method that would
change the background.  There could be problems with XOR drawing
though, since XOR drawing has had long standing bugs in it that Sun
has not yet fixed.

-Christopher

Christopher Hylands[EMAIL PROTECTED]  University of California
Ptolemy/Gigascale Silicon Research Center US Mail: 558 Cory Hall #1770
ph: (510)643-9841 fax:(510)642-2739   Berkeley, CA 94720-1770
home: (510)526-4010   (Office: 400A Cory)

> Cheers
> 
> -- 
> Marco Antoniotti 
> NYU Courant Bioinformatics Grouptel. +1 - 212 - 998 3488
> 719 Broadway 12th Floor fax  +1 - 212 - 995 4122
> New York, NY 10003, USA http://bioinformatics.cat.nyu.edu
> "Hello New York! We'll do what we can!"
>Bill Murray in `Ghostbusters'.


Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Re: Ptplot question

2003-03-26 Thread Christopher Hylands
The ptolemy-hackers mailing list is gatewayed to
comp.soft-sys.ptolemy, so yes, you are using the right news group.

http://ptolemy.eecs.berkeley.edu/java/ptplot/
has a link to
http://ptolemy.eecs.berkeley.edu/java/ptplot/ptolemy-plot-servlet.tar.gz
which 
"is a gzipped tar file that contains sample code to use Ptplot as a
servlet. The code was written by Alberto Gobbi, and has _not_ been
tested by the Ptplot pteam at UC Berkeley."

There is a also a link to
http://ptolemy.eecs.berkeley.edu/java/ptplot/exportPNG-0.0.1.patch.gz

which 
"is a gzipped patch to Ptplot 5.2 by Bernard Guillot that "allows Easy
Export to PNG. This in turn becomes an easy path to export to GIF and
JPG.". Portions of the patch are under the GNU Lesser General Public
License 2.1, see http://www.gnu.org/copyleft/lesser.html for details."

-Christopher

Christopher Hylands[EMAIL PROTECTED]  University of California
Programmer/Analyst Chess/Ptolemy/GSRC US Mail: 558 Cory Hall #1770
ph: 510.643.9841 fax:510.642.2739 Berkeley, CA 94720-1770
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480  (office: 400A Cory)





Hi
I am a newbie using Ptplot. I hope i am in the good newsgroup.

I know it is possible to use ptplot as an applet or in my own
application.
I did it.

I would like to know if it is possible to use ptplot in JSP script on a
tomcat server,
ptplot generating images in gif, jpg or png format.

Have a nice day
Alain

--
[EMAIL PROTECTED] - Atlantide - http://www.ago.fr/atlantide/
Technopole Brest Iroise BP 80802 - 29608 Brest cedex - France -
Tel. : +33 (0)2 98 05 43 21 - Fax. : +33 (0)2 98 05 20 34 - e-mail:
[EMAIL PROTECTED]
Centre Affaires Oberthur - 74D, rue de Paris -  35700 Rennes - France
Tel. : +33 (0)2 99 84 15 84 - Fax : +33 (0)2 99 84 15 85 - e-mail:
[EMAIL PROTECTED]



Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]


Re: ptplot and system crashes

2000-03-18 Thread Christopher Hylands

This is the right place to post questions about ptplot.

In general, an applet should never freeze your computer.
If it does, it is a bug with the OS and with the JDK.

[I might argue that one definition of an operating system is a system
that prevents user level programs from hanging freezing the computer,
but that is a different kettle of fish :-)]

I suspect that you are running Windows 95/98?

I've seen a fair amount of misbehaviour with applications and 95/98
which ended up require a reboot.  If you are indeed running 95/98, and
you have access to a modern operating system, such as Linux or NT or
Windows 2000 you might try reproducing the bug there.

You don't mention which version of ptplot you are running, so it is
difficult for me to diagnose the problem.  The applet portion of
Ptplot3.1 will compile with JDK1.1.x, but the application portion uses
Swing, so Ptplot3.1 is easiest to compile with JDK 1.2.2

The applet portion and the application portion of the version of
Ptplot that is shipped with Ptolemy II 0.4beta requires Swing, so
it is fairly tricky to get it to compile under JDK1.1 - you should
just use JDK1.2

BTW - The Ptplot version in Ptolemy II0.4beta has a problem with
deadlocking in applets, I'm working on a fix for that now.

I'm not familiar with Jbuilder, so I can't comment on it.

If you are running Ptplot2.1, you might try upgrading to 3.1.
Also, try running the applets on the Ptolemy Ptplot web page
http://ptolemy.eecs.berkeley.edu/java/ptplot/
and see if you can narrow the bug down to a particular version.

If you are still having problems, let me know what OS you are running,
what versions of IE and Netscape Navigator you tried, what version of
ptplot you tried, and whether you were able to reproduce the problem
with web pages on the Ptolemy website.

Let me know how it goes.
-Christopher
 


Hello,

Sorry if this is not the right place to post this problem.  I know of no
other.  I am trying to use ptplot in an applet and it freezes the
compouter (no mouse, etc.) with both IE and Netscape in MS Windows. 
This happens with most systems but not all.  One computer can
successfully view the pages containing the applets.  I have tried
compiling ptplot with 1.1.8 in jbuilder 3 and still no difference.

david koski
[EMAIL PROTECTED]



Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Re: ptplot and system crashes

2000-03-20 Thread David Koski

Christopher Hylands wrote:
> 
> This is the right place to post questions about ptplot.
> 
> In general, an applet should never freeze your computer.
> If it does, it is a bug with the OS and with the JDK.
> 
> [I might argue that one definition of an operating system is a system
> that prevents user level programs from hanging freezing the computer,
> but that is a different kettle of fish :-)]
> 
> I suspect that you are running Windows 95/98?

Yes, I am (blush) running Windows 98.  That is unfortunately the
platform we must develop for.  One could argue then that it is not an
operating system, heh.

> I've seen a fair amount of misbehaviour with applications and 95/98
> which ended up require a reboot.  If you are indeed running 95/98, and
> you have access to a modern operating system, such as Linux or NT or
> Windows 2000 you might try reproducing the bug there.

I did try OS/2 (and I think Linux.. I don't have X here at work but I do
at home).  With the latest Netscape in OS/2 it doesn't crash but the
scrolling bar does not work with three ptplot applets positioned
vertically.

> You don't mention which version of ptplot you are running, so it is
> difficult for me to diagnose the problem.  The applet portion of
> Ptplot3.1 will compile with JDK1.1.x, but the application portion uses
> Swing, so Ptplot3.1 is easiest to compile with JDK 1.2.2
 
Sorry for leaving that information out.  The README file says ptplot3.1
and it was aquired two or three weeks ago from berkeley.edu.


 
> If you are still having problems, let me know what OS you are running,
> what versions of IE and Netscape Navigator you tried, what version of
> ptplot you tried, and whether you were able to reproduce the problem
> with web pages on the Ptolemy website.

IE 5.0 and Netscape 4.7.. but there is a new wrinkle.  I have replaced
the  tags with  and  tags and got a test plot to
work.  Of course this requires a plugin.  It looks like the built-in JRE
is the biggest problem.  The problem now is supporting Linux, OS/2 and
others.  Besides, the plugin requires an extra step and therefore more
potential technical support.

I have tried all the demo applets on the Ptolemy page and they all run
flawlessly.  However, in the process of expermenting with plotML I have
suceeded to again crash my (win98) system even with the /
tags.  Come to think of it, the problems seem to exist only when using
plotML by referencing the dataurl parameter.  (I'm not positive though.)

I thought java was safer than this.  I have not had this much problem
with c/c++, wild pointers and all.

On the positive side, ptplot is a great package and provides all we need
and more.  Now when I get these language or platform issues resolved we
will have just what we were looking for.

Thank You,
David Koski
[EMAIL PROTECTED]
[EMAIL PROTECTED]

> 
> 
> Hello,
> 
> Sorry if this is not the right place to post this problem.  I know of no
> other.  I am trying to use ptplot in an applet and it freezes the
> compouter (no mouse, etc.) with both IE and Netscape in MS Windows.
> This happens with most systems but not all.  One computer can
> successfully view the pages containing the applets.  I have tried
> compiling ptplot with 1.1.8 in jbuilder 3 and still no difference.
> 
> david koski
> [EMAIL PROTECTED]
> 
> 
> 
> Posted to the ptolemy-hackers mailing list.  Please send administrative
> mail for this list to: [EMAIL PROTECTED]


Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Re: ptplot, xticks and zoom

2000-04-03 Thread Christopher Hylands

Offhand, I'm not sure what the best way to do this would be, but what
I would do is hack around in PlotBox inside the _zoom() method so that
it attempts to recalculate the ticks and updates the variables
associated with the ticks.

I'm not sure if it would be possible to do this without modifying
PlotBox, as most of the tick related variables are private variables.
It might be possible to modify PlotBox so that more of the tick axes
methods and variables are exposed and then modify those variables from
your derived class

In general, the axes labelling code in PlotBox is very complex.  At
first glance, it seems like it would be easy to label axes, but it
turns out that the corner cases are tricky.

Having a plotter that plots using dates would be useful, but we have
no plans to implement this anytime soon.

-Christopher



Hello,

I have successfully subclassed from PlotMLApplet to display data from a
remote source using the dataurl parameter.  The connection is relatively
slow so and the x scale will always be time/date so it makes sense to
generate the xticks in the applet.  Also, with a large data set the
xticks could be generated for every zoom making it unnecessary to
maintain a very large vector of ticks of which only a subset would be
displayed.

What is the cleanest way to hook the zoom event in an applet derived
from PlotMLApplet for recreating the xtick vector?

Thanks,
David Koski
[EMAIL PROTECTED]

---
   -
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Re: ptplot, xticks and zoom

2000-04-04 Thread David Koski

It looks like I could modify PlotApplet.java to get access to the _plot
member.  Then I could subclass Plot and new the subclassed version in my
PlotMLApplet_subclass.java init() method.  The subclassed Plot could
override PlotBox._zoom().

Or I could do as you suggest and modify _zoom in PlotBox() but to avoid
modifying ptplot altogether I was hoping for a solution something like
this:

1) create PlotMLApplet_subclass.makeXAxesLebels()

2) call above from init()

3) call same from a zoom listener

In makeXAxesLabels:

1) Plot.someXAxesDestroyMethod()

2) for each label, Plot.addXTick("my label", pos)

Any comments?

Thanks again,
David

I have done time scale axes labeling in C++ so I know it is tricky.

Christopher Hylands wrote:
> 
> Offhand, I'm not sure what the best way to do this would be, but what
> I would do is hack around in PlotBox inside the _zoom() method so that
> it attempts to recalculate the ticks and updates the variables
> associated with the ticks.
> 
> I'm not sure if it would be possible to do this without modifying
> PlotBox, as most of the tick related variables are private variables.
> It might be possible to modify PlotBox so that more of the tick axes
> methods and variables are exposed and then modify those variables from
> your derived class
> 
> In general, the axes labelling code in PlotBox is very complex.  At
> first glance, it seems like it would be easy to label axes, but it
> turns out that the corner cases are tricky.
> 
> Having a plotter that plots using dates would be useful, but we have
> no plans to implement this anytime soon.
> 
> -Christopher
> 
> 
> 
> Hello,
> 
> I have successfully subclassed from PlotMLApplet to display data from a
> remote source using the dataurl parameter.  The connection is relatively
> slow so and the x scale will always be time/date so it makes sense to
> generate the xticks in the applet.  Also, with a large data set the
> xticks could be generated for every zoom making it unnecessary to
> maintain a very large vector of ticks of which only a subset would be
> displayed.
> 
> What is the cleanest way to hook the zoom event in an applet derived
> from PlotMLApplet for recreating the xtick vector?
> 
> Thanks,
> David Koski
> [EMAIL PROTECTED]
> 
> ---
>-
> Posted to the ptolemy-hackers mailing list.  Please send administrative
> mail for this list to: [EMAIL PROTECTED]
> 


Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Re: ptplot sometimes paints - sometimes not

2002-06-06 Thread cxh


[EMAIL PROTECTED] (Michael R3 Reutter) writes:

> I'm using ptplot5.1p2 and want to create images for my servlets (using
> tomcat 3.3.1 and a png- or jpegEncoderclass) !
> 
> the problem:
> the image should show the title, the named axes and the graph, but
> sometimes, parts are missing (sometimes the title is missing,
> sometimes the graph ...)! If I put something like a waiting loop
> 
> try {
>Thread.sleep(5000);
> }catch (Exception e){}
> 
> after the repaint(), the results are MUCH better (this behaviour does
> more often occur on a faster machine!!!)
> 
> what's happening - is there a method to check, whether the image is
> ready or not???
> 
> any ideas???
> any help VERY appreciated!!!
> thanks michi
> 
> Here the code I use for testing in my servlet:
> 
> [...]
> Plot p = new Plot();
> p.clear(true);
> p.setTitle("T I T L E : " + counter);
> p.setXLabel("XLabel");
> p.setYLabel("YLabel");
> p.setButtons(true);
> p.addLegend(0, "Legend1");
> boolean first = true;
> for (int a = -1 ; a <= counter; a++){
>   p.addPoint(0, a, a*a, !first);
>   first = false;
> }
> p.validate();
> p.repaint();
> java.awt.image.BufferedImage image = p.exportImage();

You could try pulling the classes out of the Ptolemy II 2.0-beta
release tree and using those, but I'm not sure if there is
a change that particularly addresses the issue you are having.

Below are the changes:

--start--
The changes between ptplot5.1p3 and ptplot5.2

* David French: added removeLegend()
* John Olmstead, Edward A. Lee: rotate Y axis label
* Christopher Hylands: Use .plt and .xml as default extensions when
opening or saving as, use plot.xml as a default name
* Roger Schwenke, Christopher Hylands: Add better documentation
about how to use Log axes.
* Alberto Gobbi, Christopher Hylands:
Fix for  to PlotMLParser.java

The changes between ptplot5.1p2 and ptplot5.1p3

* Ross Beyer: Problems with Solaris installation.
* Laurent Etur: Scale the printout to fit the page
--end--

We don't have a servlet set up locally, so I can't directly test your 
set up.  Alberto Gobbi contributed some servlet code, which we have
not tested, but you can find at

http://ptolemy.eecs.berkeley.edu/java/ptplot/ptolemy-plot-servlet.tar.gz

[EMAIL PROTECTED] (Michael R3 Reutter) writes:
> Because of the problems I have with ptplot (see my other posting):
> Does anyone of you know another 2D-plot-java-package???

I don't know of anything else out there for servlets, but I'm sure
that there must be something.

-Christopher

Christopher Hylands[EMAIL PROTECTED]  University of California
Ptolemy/Gigascale Silicon Research Center US Mail: 558 Cory Hall #1770
ph: (510)643-9841 fax:(510)642-2739   Berkeley, CA 94720-1770
home: (510)526-4010, (707)665-0131(office: 400A Cory)



Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Re: ptplot applet look and feel (#2)

2001-09-27 Thread Christopher Hylands

Right now, there is no easy way to change the way the labels are
printed in ptplot.  The code surrounding label and tick placement has
a fair amount of art in it.  You could go in and hack the code to
write the label text in a different order.

Note that it is possible to write text at an angle:

http://java.sun.com/people/linden/faq_c.html#AWT
Says
--start--
Sect. 10) How can I write text at an angle? 
 Check out http://www.nyx.net/~jbuzbee/font.html. Jim has some code to
do exactly this. A good way to do it is to draw the text to an
offscreen image and write an ImageFilter to rotate the image. 

Also, from JDK 1.2 on, the Java 2D API handles arbitrary shapes, text,
and images and allows all of these to be rotated, scaled, skewed, and
otherwise transformed in a uniform manner. A code example would be: 

import java.awt.*;
import java.awt.geom.*;
public class r extends Frame {

public static void main(String args[]) { new r(); }

r() { setSize(200,200); setVisible(true); }

public void paint(Graphics g) {
Graphics2D g2D = (Graphics2D) g;
AffineTransform aft = new AffineTransform();
aft.setToTranslation(100.0, 100.0);
g2D.transform(aft);
aft.setToRotation(Math.PI / 8.0);
String s = "Rotated Hello World";

for (int i = 0; i < 16; i++) {
g2D.drawString(s, 0.0f, 0.0f);
g2D.transform(aft);
}
}
}

There is more info about the 2D API at
http://java.sun.com/products/java-media/2D/index.html and
http://developer.javasoft.com/developer/technicalArticles/ 
---end---

Multi-line titles are not well supported, again, because of the magic
involved in laying the legend, the title, the labels and the plot area
out.

It might be worth looking at using a layout manager to handle this
functionality in Ptplot.  When we first wrote Ptplot, JDK1.0.2 was the
latest and greatest version and the layout managers were Byzantine.
Too bad AWT did not take a page out of how Tcl handles packing.

-Christopher


Ok, I've figured out how to add some XML parsing so I can set font
size in my xml files.

Now, I'm wondering if it is possible to make the text on the yLabel
so that it reads left to right if you turned the monitor clockwise
90 degrees.  Right now it looks like:

I

a
m

t
h
e

y

l
a
b
l
e

I'd like it to read "I am the y label" if I turned my head.

Is this possible?

Also, it looks like it's possible to do a multi-lined title, but
when I tried it a while back it didn't seem to work.  How do I make
the title of the plot span multiple lines?

-Chris

-- 

Christopher N. Deckard  | Lead Web Systems Developer
  [EMAIL PROTECTED]|Engineering Computer Network
  http://www.ecn.purdue.edu/| Purdue University 
 zlib.decompress('x\234K\316Kq((-J)M\325KM)\005\000)"\005w') ---

---
   -
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



Re: ptplot questions: color change and interactive selection

2003-04-03 Thread Christopher Hylands
In comp.soft-sys.ptolemy, [EMAIL PROTECTED] (Gabriel Chime) writes:

> Hi,
> I'm trying to decide what plotting package to use for a brand new
> project,
> and ptplot is one of the top candidates.
> 
> I have two questions:
> 1) Can I change the color of a subset of plotted points on the fly?

Basically, PlotBox has an array of Colors that is predefined.

PlotBox.setColors() allows you to a
/** Set the point colors.  Note that the default colors have been
 *  carefully selected to maximize readability and that it is easy
 *  to use colors that result in a very ugly plot.
 *  @param colors Array of colors to use in succession for data sets.
 *  @see #getColors()
 */
public void setColors(Color[] colors) {
_colors = colors;
}

See also
http://groups.yahoo.com/group/ptolemy-hackers/message/1655


> 2) On an ordinary x-y scatter plot, can I select a set of points by
> drawing a rectangle around them?
> In all the examples I've seen, drawing a rectangle was used for
> zooming.
> Instead of zooming, I want to change the color of the points within
> the rectangle and report the selected set of points back to the object
> that
> created the plot.
> Is that possible? 

Yes, it is possible.  Look at the zoom code and see how it maps
mouse clicks back to x/y coordinates.

You could also look how
ptolemy/plot/EditListener.java
works, where it is an interface that has one method

/** Notify that data in the specified plot has been modified
 *  by a user edit action.
 *  @param source The plot containing the modified data.
 *  @param dataset The data set that has been modified.
 */
public void editDataModified(EditablePlot source, int dataset);


EditablePlot then implements that interface and permits the user
to modify the plot data.

There is no code to do specifically what you want, but the two items
above should get you started

-Christopher

Christopher Hylands[EMAIL PROTECTED]  University of California
Programmer/Analyst Chess/Ptolemy/GSRC US Mail: 558 Cory Hall #1770
ph: 510.643.9841 fax:510.642.2739 Berkeley, CA 94720-1770
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480  (office: 400A Cory)



Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]