Axis range limitation + Vertical Tick Width
Axis range limitation + Vertical Tick Width
Hi,
when I want to display small values, I have no information on my curve's range on the Y axis.
See images :
this one is still OK : 1e-7 * sin(x)
http://img470.imageshack.us/my.php?imag ... es2gu9.jpg
this one is not OK : 1e-8 * sin(x)
http://img217.imageshack.us/my.php?imag ... es1gh9.jpg
Thank you for your help.
Regards.
Hugues Legardeur.
when I want to display small values, I have no information on my curve's range on the Y axis.
See images :
this one is still OK : 1e-7 * sin(x)
http://img470.imageshack.us/my.php?imag ... es2gu9.jpg
this one is not OK : 1e-8 * sin(x)
http://img217.imageshack.us/my.php?imag ... es1gh9.jpg
Thank you for your help.
Regards.
Hugues Legardeur.
Last edited by hugues on Wed Jan 10, 2007 10:25 am, edited 1 time in total.
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com
may be just an other renderer could do the job ?
any idea ?
Hugues
any idea ?
Hugues
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com
A solution seems to be in the pipe (I hope so) with those few lines :
Hugues
I ll have to program that properly next week.NumberFormat aDF = new DecimalFormat("##0.#####E0");
NumberTickUnit aNTU = new NumberTickUnit(10.e-10);
NumberAxis aAxis = (NumberAxis) myXYPlot.getRangeAxis();
aAxis.setNumberFormatOverride(aDF);
aAxis.setTickUnit(aNTU);
Hugues
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com
For the next version of my software, I will try this solution :
1. I use an Homemade TickUnits : FunctionJFreeTickUnits
1. I use an Homemade TickUnits : FunctionJFreeTickUnits
2. I modify the AutoRangeMinimumSizeDecimalFormat aDf11 = new DecimalFormat("##0.#####E0");
// we can add the units in any order, the TickUnits collection will
// sort them...
add(new NumberTickUnit(1.e-20, aDf11));
add(new NumberTickUnit(1.e-19, aDf11));
add(new NumberTickUnit(1.e-18, aDf11));
add(new NumberTickUnit(1.e-17, aDf11));
add(new NumberTickUnit(1.e-16, aDf11));
add(new NumberTickUnit(1.e-15, aDf11));
add(new NumberTickUnit(1.e-14, aDf11));
add(new NumberTickUnit(1.e-13, aDf11));
add(new NumberTickUnit(1.e-12, aDf11));
add(new NumberTickUnit(1.e-11, aDf11));
add(new NumberTickUnit(1.e-10, aDf11));
add(new NumberTickUnit(1.e-9, aDf11));
add(new NumberTickUnit(1.e-8, aDf11));
add(new NumberTickUnit(0.0000001, aDf1));
add(new NumberTickUnit(0.000001, aDf2));
add(new NumberTickUnit(0.00001, aDf3));
add(new NumberTickUnit(0.0001, aDf4));
add(new NumberTickUnit(0.001, aDf5));
add(new NumberTickUnit(0.01, aDf6));
add(new NumberTickUnit(0.1, aDf7));
add(new NumberTickUnit(1, aDf8));
add(new NumberTickUnit(10, aDf8));
add(new NumberTickUnit(100, aDf8));
add(new NumberTickUnit(1000, aDf8));
add(new NumberTickUnit(10000, aDf8));
add(new NumberTickUnit(100000, aDf8));
add(new NumberTickUnit(1000000, aDf9));
add(new NumberTickUnit(10000000, aDf9));
add(new NumberTickUnit(100000000, aDf9));
add(new NumberTickUnit(1000000000, aDf10));
add(new NumberTickUnit(10000000000.0, aDf10));
add(new NumberTickUnit(100000000000.0, aDf10));
add(new NumberTickUnit(1.0e12, aDf11));
add(new NumberTickUnit(1.0e13, aDf11));
add(new NumberTickUnit(1.0e14, aDf11));
add(new NumberTickUnit(1.0e15, aDf11));
add(new NumberTickUnit(1.0e16, aDf11));
add(new NumberTickUnit(1.0e17, aDf11));
add(new NumberTickUnit(1.0e18, aDf11));
add(new NumberTickUnit(1.0e19, aDf11));
add(new NumberTickUnit(1.0e20, aDf11));
resultat http://img205.imageshack.us/my.php?image=gr10pj6.jpg//
// new Tick Units for low values (under 1e-8)
theAxis.setStandardTickUnits(new FunctionJFreeTickUnits());
//
// set the lowest limit of the auto range lower the the default (1e-8)
theAxis.setAutoRangeMinimumSize(1.0e-19);
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com
Vertical Tick Width
My other problem is to control the vertical tick width in order to align 2 graphics.
See picture :
http://img206.imageshack.us/my.php?image=gr11jk7.jpg
I tried :
What else could I try ?
Thanks a lot.
Hugues.
See picture :
http://img206.imageshack.us/my.php?image=gr11jk7.jpg
I tried :
But it doens't give the expected result.myXYPlot.getRangeAxis().setFixedDimension(30.);
What else could I try ?
Thanks a lot.
Hugues.
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Vertical Tick Width
You'll need to set the fixed dimension on both range axes (that is, in both plots). Also, I don't know how wide you need to make it, but it probably needs to be something wider than 30 Java2D units.hugues wrote:I tried :But it doens't give the expected result.myXYPlot.getRangeAxis().setFixedDimension(30.);
What else could I try ?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Re: Vertical Tick Width
This will probably be the solution for a future version. But no time to do that at the moment.cme_st wrote:Try org.jfree.chart.plot.CombinedDomainXYPlot. It combines you two plots. You can find some examples for combined plots in the JFreeChart examples.
Chris
I used setFixedDimension on both chart of course. I will try wider values.david.gilbert wrote:You'll need to set the fixed dimension on both range axes (that is, in both plots). Also, I don't know how wide you need to make it, but it probably needs to be something wider than 30 Java2D units.hugues wrote:I tried :But it doens't give the expected result.myXYPlot.getRangeAxis().setFixedDimension(30.);
What else could I try ?
thanks all.
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com
Hello again,
the method "setFixedDimension" did not suit my request so I found a solution which was to create a new class over "NumberAxis" to redefine the method "findMaximumTickLabelWidth" (from ValueAxis). This method retruns now a constant value.
Hugues
the method "setFixedDimension" did not suit my request so I found a solution which was to create a new class over "NumberAxis" to redefine the method "findMaximumTickLabelWidth" (from ValueAxis). This method retruns now a constant value.
Thanks again for your Help.public class FunctionJFreeNumberAxis extends NumberAxis {
public FunctionJFreeNumberAxis() {
this(null);
}
public FunctionJFreeNumberAxis(String theLabel) {
super(theLabel);
}
protected double findMaximumTickLabelWidth(List ticks, Graphics2D g2, Rectangle2D drawArea, boolean vertical) {
return 75;
}
}
Hugues
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com