"Christopher N. Deckard" <[EMAIL PROTECTED]> writes:

> Greetings,
> Briefly, I am doing simple point plotting using PtPlot's java applet.  I 
> am using an XML input to PtPlot for configuration and datasets for the 
> plot.  The documentation that comes with the PtPlot package does not 
> seem to have much information on using XML, except for the very basics.
> 
> What I'm wondering is if I can do more in XML without having to write 
> and compile java code to make the plots look the way I want.
> 
> At the end of my message is an example XML style PtPlot input that I am 
> using.
>
> 
> Question #1
> If you use this as input for a plot, you'll notice that The yLabel 
> streches out of the plot and gets cut off.  It is even worse with longer 
> labels.  Sometimes the text from the labels overlaps that of the 
> increments for the y Axis.  This makes it very hard to read.
> 
> One solution for this is to increase the size of the plot, which I can 
> do, but as this is viewed through a web browser, I can't make the plot 
> so huge that users have to scroll the window to see things.
> 
> So, that is question one.  How do I get labels and titles to fit better 
> on the plot.

The quick answer is to either use shorter labels or a specify a larger
size.

The longer answers require hacking around in Java and recompiling,
below are some ideas:

1. edit ptolemy/plot/PlotBox.java and change the default font from 
_labelFont = new Font("Helvetica", Font.PLAIN, 12);
to something smaller

2. ptolemy/plot/PlotBox.java includes a setLabelFont() method that
does not have an XML counter part.  You could add xml that would
call setLabelFont()

3. You could modify PlotBox.java so that if the label was too big for
the space, then smaller fonts would automatically be tried until the
label fit.

> Question #2
> Is there a way to make the scale of the graph different, for example 
> displaying in scientific notation instead of 10^2?

You could use the xTicks and yTicks directive to specify different
scales.

Or, you could modify the java tick labeling code to print scientific
notations.   This code is fairly complex . . .

> Question #3
> Has anyone gotten the PtPlot applets to work under Netscape 4.x?  Will 
> the applets run with a version of java below 1.3?  If so, how can I make 
> that happen?  I've tried just changing version numbers in the HTML 
> configuration for the applet, but that had no effect.  Right now it 
> seems as though I'm limited to using Mozilla or Netscape 6.1 w/the Java 
> plugin, or IE 5.5 with Java.

I use Ptplot5.1p1 all the time with Netscape 4.76 with the Java 1.3.1
plugin under Windows 2000 all the time.  Works great.  I've also used
IE 5.5.  What sort of error message are you seeing?

Ptplot3.1 does not require the Java plugin.
You can use Ptplot3.1 with the Java 1.1 that ships with Netscape and
IE.

It sounds like your Netscape 4.x/Java 1.3 Plugin installation is
broken.
You might try running some of the Java plugin examples at
http://java.sun.com/products/plugin/

You might try uninstalling the plugin and reinstalling it, or
uninstalling the plugin and netscape then then reinstalling them
For other ideas, see

http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII1.0/ptII1.0/doc/troubleshooting.htm#applets

> Question #4

> When graphing logarithmic plots, the increments of the plot start out as 
> if they are linear.  Only when the user clicks on the "scale to fit" 
> button is the plot viewable.  How do I go about getting it to show up 
> right away?  Do I have to give the X and Y axis my own scales and 
> increments?

Hmm, we had a bug like this in the past, but when I go to
http://ptolemy.eecs.berkeley.edu/java/ptplot5.1p1/ptolemy/plot/demo/LogAxes.htm
under Netscape 4.76 with the Java Plug-in 1.3.1 under Windows 2000,
everything looks fine.  The axes come up, and I don't have to hit
'scale to fit'.  I added
<xLog/>
<yLog/>
to your sample file and it came up fine as well.

Does the above applet behave correctly for you?
What OS are you running?
Does the problem occur when you are running an applet or an
application?

> I'm sure I'll have more questions.  I'm still new to the program.  I 
> like being able to use XML as input.  It's much cleaner for me to 
> generate and make sense of.  Is there a document that will describe all 
> of the XML tags that I can use to configure a plot? or are the ones that 
> I'm using already pretty much it?

Yep, XML is easier to use than yet another nonstandard syntax.

The source code is the best documentation.

The ptplot chapter of the Ptolemy Design document describes PlotML as
well, see
http://ptolemy.eecs.berkeley.edu/java/ptplot5.1p1/ptolemy/plot/doc/plot.pdf

-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)

> 
> Thanks,
> -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') ---
> 
> 
> Here is one of my sample XML inputs to PtPlot.  You will see how basic 
> it is.
> 
> ___xml file___
> 
> <?xml version="1.0" standalone="yes"?>
> <!DOCTYPE plot PUBLIC "-//UC Berkeley//DTD PlotML 1//EN"
>    "http://ptolemy.eecs.berkeley.edu/archive/plotml.dtd";>
> <plot>
> <title>Aluminum Film Thermal Conductivity (W m[-1] K[-1])</title>
> <xLabel>Temperature (K)</xLabel>
> <yLabel>Thermal Conductivity </yLabel>
> <xRange min="200.0" max="600.0"/>
> <yRange min="184.8" max="230.6"/>
> <size width="480" height="360"/>
> <dataset name="Dataset 1" marks="various" connected="yes">
> <p x="200.0" y="184.8"/>
> <p x="250.0" y="195.6"/>
> <p x="300.0" y="201.9"/>
> <p x="350.0" y="207.2"/>
> <p x="400.0" y="210.2"/>
> <p x="450.0" y="212.4"/>
> <p x="500.0" y="213.7"/>
> <p x="550.0" y="214.3"/>
> <p x="600.0" y="215.4"/>
> </dataset>
> <dataset name="Dataset 2" marks="various" connected="yes">
> <p x="200.0" y="207.5"/>
> <p x="250.0" y="214.1"/>
> <p x="300.0" y="217.8"/>
> <p x="350.0" y="220.8"/>
> <p x="400.0" y="222.4"/>
> <p x="450.0" y="223.4"/>
> <p x="500.0" y="223.5"/>
> <p x="550.0" y="223.2"/>
> <p x="600.0" y="223.3"/>
> </dataset>
> <dataset name="Dataset 3" marks="various" connected="yes">
> <p x="200.0" y="224.3"/>
> <p x="250.0" y="227.3"/>
> <p x="300.0" y="228.8"/>
> <p x="350.0" y="230.0"/>
> <p x="400.0" y="230.5"/>
> <p x="450.0" y="230.6"/>
> <p x="500.0" y="229.8"/>
> <p x="550.0" y="228.9"/>
> <p x="600.0" y="228.4"/>
> </dataset>
> 
> </plot>
> 
> ___xml file___

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

Reply via email to