Is it possible to add a Range Marker to a CombinedRange plot

A discussion forum for the JCommon class library.
Locked
jt_swanson
Posts: 18
Joined: Sat Jun 02, 2012 6:12 pm
antibot: No, of course not.

Is it possible to add a Range Marker to a CombinedRange plot

Post by jt_swanson » Tue Jun 12, 2012 11:45 pm

I need to emphasize the y = 0.0 line in my CombinedRangeXYPlot. Naively, I thought I could do this-

Code: Select all

        NumberAxis          sharedAxis = new NumberAxis("residual lnk");
        CombinedRangeXYPlot plot       = new CombinedRangeXYPlot(sharedAxis);
        ValueMarker zeroMarker = 
           new ValueMarker(0.00, Color.RED, new BasicStroke(2.0f));
        plot.addRangeMarker(zeroMarker);
No line at y = 0.00 shows up in the plot.

Does anyone know if this is supposed to work?
Am I not specifying the commands correctly?
Any good workarounds, since it doesn't seem to work?

jt_swanson
Posts: 18
Joined: Sat Jun 02, 2012 6:12 pm
antibot: No, of course not.

Re: Is it possible to add a Range Marker to a CombinedRange

Post by jt_swanson » Thu Jun 14, 2012 4:17 pm

I found the solution to this. I keep thinking with the combined plot that I can add objects to the combined plot. What worked was to add two range markers to each of the individual plots before I combined them. I thought that wouldn't work, since I did not define a range individually for them, but it did work. For anyone searching for the answer to this question, I did this-

Code: Select all

      ValueMarker zeroMarker = 
              new ValueMarker(0.00, Color.RED, new BasicStroke(2.0f));

      aPlot.addRangeMarker(zeroMarker);
      bPlot.addRangeMarker(zeroMarker);

      CombinedRangeXYPlot plot = new CombinedRangeXYPlot(sharedAxis);
      plot.add(aPlot, 1);
      plot.add(bPlot, 1);

Locked