Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have to do it by hand. I've done this and my code is open source, so you're welcome to take a look at it:</p> <p><a href="https://github.com/brycecr/msmexplorer/blob/acacia/MSMExplorer/src/edu/stanford/folding/msmexplorer/util/axis/AxisRotateRenderer.java" rel="nofollow">https://github.com/brycecr/msmexplorer/blob/acacia/MSMExplorer/src/edu/stanford/folding/msmexplorer/util/axis/AxisRotateRenderer.java</a></p> <p><a href="https://github.com/brycecr/msmexplorer/blob/acacia/MSMExplorer/src/edu/stanford/folding/msmexplorer/util/axis/AxisLabelLabelLayout.java" rel="nofollow">https://github.com/brycecr/msmexplorer/blob/acacia/MSMExplorer/src/edu/stanford/folding/msmexplorer/util/axis/AxisLabelLabelLayout.java</a></p> <p>In the label renderer, all the labels are drawn as a combination of a line and a label. In this class, we just add an additional item to the layout with our graph.</p> <p>This is not super clean at all...in particular, a line (actually one pixel) is still rendered for the label, but I'm lazy and this suits my needs...I think you could improve this if necessary, but you'd probably need to reach into the axis renderer and make it draw no line for your label items.</p> <p>Let me know if you have any questions about the operation of this.</p> <pre><code> @Override public void run(double frac) { super.run(frac); setLabPos(item, length/2.0d + width, bounds); } /** * Set the layout values for an axis label item. */ protected void setLabPos(VisualItem item, double xOrY, Rectangle2D b) { switch (getAxis()) { case Constants.X_AXIS: xOrY = super.isAscending() ? xOrY + b.getMinX() : b.getMaxX() - xOrY; PrefuseLib.updateDouble(item, VisualItem.X, xOrY); PrefuseLib.updateDouble(item, VisualItem.Y, b.getMaxY() + label.getFont().getSize()/3.0d + gridLab.getFont().getSize()); PrefuseLib.updateDouble(item, VisualItem.X2, xOrY); PrefuseLib.updateDouble(item, VisualItem.Y2, b.getMaxY() + label.getFont().getSize()/3.0d + gridLab.getFont().getSize()); break; case Constants.Y_AXIS: xOrY = super.isAscending() ? b.getMaxY() - xOrY - 1 : xOrY + b.getMinY(); PrefuseLib.updateDouble(item, VisualItem.X, b.getMinX()); PrefuseLib.updateDouble(item, VisualItem.Y, xOrY); PrefuseLib.updateDouble(item, VisualItem.X2, b.getMinX()); PrefuseLib.updateDouble(item, VisualItem.Y2, xOrY); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload