Is it possible to draw an X Axis on a XYData Chart?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Scott Murphy

Is it possible to draw an X Axis on a XYData Chart?

Post by Scott Murphy » Tue May 28, 2002 9:54 pm

Hello,

I am using an XYData Chart to plot histograms of two sets of genomic data.
Because one set of data is 10,000 elements and the other is 127 elements, I group them into bins. I would like to be able to draw a y-axis line at a specific point on the x-axis to represent a threshold--a line that seperates the two histograms.

Is it possible to draw a y-axis line without including it into the dataset?
If I include it into the data set it will have a width of one of the bins which is a 100 units.

Any help appreciated

Regards,
Scott

Scott Murphy

Re: Is it possible to draw an Y Axis on a XYData Chart?

Post by Scott Murphy » Tue May 28, 2002 9:56 pm

Sorry... Meant to say Y Axis line.


ie:


| 1 / \
| /\ 1 / \
|/ \1/ \
----------------------

Chart would look like above. Where the 1s represent the line I want to draw.

Scott Murphy

Re: Is it possible to draw an X Axis on a XYData Chart?

Post by Scott Murphy » Tue May 28, 2002 9:57 pm

Imagine the ones being a straight vertical line. (looked different when I typed it)

David Gilbert

Re: Is it possible to draw an X Axis on a XYData Chart?

Post by David Gilbert » Thu May 30, 2002 12:24 pm

The XYPlot class has a couple of methods:

addHorizontalLine(...)
addVerticalLine(...)

They might help you.

These were added by someone (I forget who it was) to draw arbitrary marker lines on plots. I think there is a bug in the way the lines are drawn in 0.8.1, which is fixed now in the CVS version.

I've added a similar facility to the CategoryPlot class, but using a slightly different approach...I'll probably change the XYPlot implementation to match.

Regards,

DG.

Scott Murphy

Re: Is it possible to draw an X Axis on a XYData Chart?

Post by Scott Murphy » Wed Jun 19, 2002 9:07 am

Thanks for the help! Will try asap.

Eldar Lyn

Re: Is it possible to draw an X Axis on a XYData Chart?

Post by Eldar Lyn » Wed Jun 26, 2002 4:06 pm

I just try the addHorizontalLine method and it works like i wanted, but i've still an interrogation: is it possible to add a text near these line or in the legende?

David Gilbert

Re: Is it possible to draw an X Axis on a XYData Chart?

Post by David Gilbert » Wed Jun 26, 2002 5:35 pm

Not currently. There are plans (no work started yet) to add a list of 'annotations' to some plot types, which would probably cover what you want to do.

Regards,

DG.

Locked