CombinedDomainXYPlot issue [was parallel coordinates]

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
bobswanson
Posts: 5
Joined: Mon Aug 09, 2004 3:20 am
Location: Maui

CombinedDomainXYPlot issue [was parallel coordinates]

Post by bobswanson » Thu Aug 19, 2004 8:07 am

Thanks for the advice on devising a parallel coordinate
plot. I am making excellent progress with this project,
using JFreeChart as the basis.

The problem I'm having is with using multiple plots inside
a CombinedDomainXYPlot object. As the image in
the URL shows, there is a lot of "whitespace" between
the individual plots. I would like to have greater control
of the layout, and make each plot as large as space
will allow, and show as little space as
possible between each plot, still allowing for the header name
that identifies the axis.

Any ideas on how to tame the combined XY plot?

Thanks,

Bob Swanson

Image:

http://www219.pair.com/swansonr/test3.jpg

bobswanson
Posts: 5
Joined: Mon Aug 09, 2004 3:20 am
Location: Maui

Re: CombinedDomainXYPlot issue [was parallel coordinates]

Post by bobswanson » Fri Aug 20, 2004 6:17 am

bobswanson wrote:
The problem I'm having is with using multiple plots inside
a CombinedDomainXYPlot object. As the image in
the URL shows, there is a lot of "whitespace" between
the individual plots. I would like to have greater control
of the layout, and make each plot as large as space
will allow, and show as little space as
possible between each plot, still allowing for the header name
that identifies the axis.

Worse yet, I just tested an example with 10 panels, and there
were NO PLOTS, just the headings and a lot of whitespace.
This happened whether I made the window full-screen or
not. I guess I need to figure out another way to do this type
of plotting.

Bob Swanson

enrico
Posts: 49
Joined: Thu Jul 22, 2004 7:13 pm
Location: Shaanxi, P.R.China

Post by enrico » Fri Aug 20, 2004 8:50 am

setGap() to control the gap between subplots

Guest

Post by Guest » Fri Aug 20, 2004 8:47 pm

enrico wrote:setGap() to control the gap between subplots
Tried that. I forced the setGap to various values
including zero and the setting does not seem to
make any observable difference in the layout.

What I think is happening is that space is being
allocated for the axis, but as the image shows,
I've turned off axis visibility. Also, the font
of the headings seems to change as I resize
the plot. When I try to overcome the layout issue
by making the window full-screen, the heading fonts
seem to also grow in size. (hopefully not an optical
illusion)

bobswanson
Posts: 5
Joined: Mon Aug 09, 2004 3:20 am
Location: Maui

Re: CombinedDomainXYPlot issue [was parallel coordinates]

Post by bobswanson » Wed Aug 25, 2004 2:45 am

bobswanson wrote:
The problem I'm having is with using multiple plots inside
a CombinedDomainXYPlot object. As the image in
the URL shows, there is a lot of "whitespace" between
the individual plots. I would like to have greater control
of the layout, and make each plot as large as space
will allow, and show as little space as
possible between each plot, still allowing for the header name
that identifies the axis.
I have "solved" the problem by using GridLayout with
each individual panel of the parallel coordinate plot
in a grid position.

While this introduces some other issues, they seem to
be doable, and there is no longer a layout problem.

See:

http://www219.pair.com/swansonr/new_parallel.jpg


Bob Swanson

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Aug 25, 2004 9:09 am

I think the problem with your orginal approach is caused by the maximumDrawWidth in the ChartPanel class. The default value is 800 (I think), which means that when the ChartPanel is wider than 800 pixels, the chart is drawn with a width of 800 and then stretched to fit the panel. This is a way to "cap" the size of the BufferedImage that stores the chart.

You can use the setMaximumDrawWidth() method to set this value to something larger.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Guest

Post by Guest » Thu Sep 02, 2004 1:16 am

david.gilbert wrote:I think the problem with your orginal approach is caused by the maximumDrawWidth in the ChartPanel class. The default value is 800 (I think), which means that when the ChartPanel is wider than 800 pixels, the chart is drawn with a width of 800 and then stretched to fit the panel. This is a way to "cap" the size of the BufferedImage that stores the chart.

You can use the setMaximumDrawWidth() method to set this value to something larger.
Well, I did not try to alter that value, but instead
eliminated the display of ALL axes for the
individual panels. Good news! Nearly all of the
whitespace disappeared. The chart is quite
useable now. Unfortunately, a small amount
of whitespace still appears at the "bottom" of
each chart panel, where the "x" axis would have
been displayed. In the screenshot referred to
below, there is a small gap on the right side
of each panel, corresponding to the description
above.

The good news: We're nearly there!


See:

http://www219.pair.com/swansonr/parallel_example.jpg


Thanks for all the advice.

Bob Swanson

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Sep 02, 2004 9:28 am

The gap at the right side of each subplot is the axis margin (5% by default). Use the setUpperMargin() method (in the ValueAxis class) to set this to 0.0.

I'm not sure about the other gap you refer to.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Guest

Post by Guest » Sat Sep 04, 2004 3:47 am

david.gilbert wrote:The gap at the right side of each subplot is the axis margin (5% by default). Use the setUpperMargin() method (in the ValueAxis class) to set this to 0.0.

I'm not sure about the other gap you refer to.
Sorry for the confusion. It was the same gap, just rotated. That
is, the area just below each individual plots' X axis
label (non visible) would be the location of the gap.
Essentially, there is some whitespace at the "bottom" of each plot,
that I cannot seem to get rid of.

I tried setting not only the UpperMargin but also
the LowerMargin to 0 and the gap did not disappear.

Thanks again for your help.

Bob Swanson

bobswanson
Posts: 5
Joined: Mon Aug 09, 2004 3:20 am
Location: Maui

Case Closed

Post by bobswanson » Wed Sep 08, 2004 12:15 am

Turns out that I did not realize that the CombinedDomainXYPlot
destroys any existing reference to the domain axis in the subplots.
By specifying the custom axis when creating the combined
plot, that axis then behaves as programmed, and has no whitespace
problem.

Consider the matter closed, and parallel coordinates
implemented using JFreeChart!

Thanks again for all the help and pointers.


Bob Swanson

Locked