> 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:
<dataset marks="various">

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 revamp PlotBox to use a different layout
manager and add an right hand y-axis.



> 4.  I would like to override the ZoomListener so that I can select
> certain points and display their value in the ToolTip or in a popup
> box.  Basically, I will need to let the cursor do perform zooming in
> certain modes, and point selection in other modes.  Has anyone
> experimented with doing this?

Various people have asked about this.  Looking at the ZoomListener
code is the place to start.  I'm not sure if you need to extend
the ZoomListener or just add another listener.
One question is where do you store the tooltip data or text.
Adding it to poor old PlotPoint will just increase the size.

We don't have any code that does any of this.

> 5. Can I explicitly set the color of an individual trace?

You can call PlotBox.setColors(Color[] colors) to set all
the colors for all the datasets.  Note that the colors we
have were carefully selected to maximize readability.

You could modify PlotBox so that you expose the _colors array
by having a method that would update a particular entry,
but note that the _colors array gets reused for different
datasets.  The initial default _colors array has
11 colors, so the first color (red), is used on the
first dataset and the twelfth.

You could try to have store the color for a particular
dataset and override the default color

> Thanks again for all your help.  
> 
> Erich Roth
> 
> ~~~~~~~~~~~~~~~
> Erich G. Roth, Ph.D.
> Onset Computer Corporation
> Bourne, MA
> www.onsetcomp.com
> 508.759.9500

-Christopher

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

Reply via email to