Examples of SVGPlot


Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot

    }
  }

  @Override
  public Visualization makeVisualization(VisualizationTask task) {
    SVGPlot svgp = task.getPlot();
    Element layer = svgp.svgElement(SVGConstants.SVG_G_TAG);
    EvaluatePairCountingFMeasure.ScoreResult sr = task.getResult();
   
    // TODO: use CSSClass and StyleLibrary
    int i = 0;
    {
      Element object = svgp.svgText(0, i + 0.7, "Same-cluster object pairs");
      object.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.6; font-weight: bold");
      layer.appendChild(object);
      i++;
    }   
    {
      Element object = svgp.svgText(0, i + 0.7, "F1-Measure, Precision and Recall:");
      object.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.6; font-weight: bold");
      layer.appendChild(object);
      i++;
    }   
    for(Vector vec : sr) {
      StringBuffer buf = new StringBuffer();
      double fmeasure = vec.get(0);
      double inboth = vec.get(1);
      double infirst = vec.get(2);
      double insecond = vec.get(3);
      buf.append(FormatUtil.format(fmeasure, FormatUtil.NF6));
      buf.append(" / ");
      buf.append(FormatUtil.format(inboth / (inboth + infirst), FormatUtil.NF6));
      buf.append(" / ");
      buf.append(FormatUtil.format(inboth / (inboth + insecond), FormatUtil.NF6));
      Element object = svgp.svgText(0, i + 0.7, buf.toString());
      object.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.6");
      layer.appendChild(object);
      i++;
    }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot

  /**
   * Save/export the current plot.
   */
  public void saveCurrentPlot() {
    // TODO: exclude "do not export" layers!
    final SVGPlot currentPlot = svgCanvas.getPlot();
    if(currentPlot != null) {
      SVGSaveDialog.showSaveDialog(currentPlot, 512, 512);
    }
    else {
      logger.warning("saveCurrentPlot() called without a visible plot!");
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot

  /**
   * Save/export the current plot.
   */
  public void saveCurrentPlot() {
    // TODO: exclude "do not export" layers!
    final SVGPlot currentPlot = svgCanvas.getPlot();
    if(currentPlot != null) {
      SVGSaveDialog.showSaveDialog(currentPlot, 512, 512);
    }
    else {
      LoggingUtil.warning("saveCurrentPlot() called without a visible plot!");
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot

   *
   * @param factory
   * @param task
   */
  private void showVisualization(VisualizerContext context, SimilarityMatrixVisualizer.Factory factory, VisualizationTask task) {
    SVGPlot plot = new SVGPlot();
    Visualization vis = factory.makeVisualization(task.clone(plot, context, null, 1.0, 1.0));
    plot.getRoot().appendChild(vis.getLayer());
    plot.getRoot().setAttribute(SVGConstants.SVG_WIDTH_ATTRIBUTE, "20cm");
    plot.getRoot().setAttribute(SVGConstants.SVG_HEIGHT_ATTRIBUTE, "20cm");
    plot.getRoot().setAttribute(SVGConstants.SVG_VIEW_BOX_ATTRIBUTE, "0 0 1 1");
    plot.updateStyleElement();

    (new SimpleSVGViewer()).setPlot(plot);
  }
View Full Code Here

Examples of net.sourceforge.gpstools.plot.SvgPlot

    public void plot(Quantity x, Quantity y, OutputStream os, String title,
            Wpt[] pts) throws IOException {
        OutputStreamWriter ow = new OutputStreamWriter(os, "utf-8");
        try {
            SvgPlot plot = getPlot(x, y, title, pts);
            configurePlot(plot, x, y);
            plot.plot(ow);
            ow.flush();
        } catch (FunctionEvaluationException ex) {
            // should never happen.
            throw new Error(ex);
        }
View Full Code Here

Examples of net.sourceforge.gpstools.plot.SvgPlot

        }
    }

    public SvgPlot getPlot(Quantity x, Quantity y, String title, Wpt[] pts)
            throws FunctionEvaluationException {
        SvgPlot plot = new SvgPlot();
        plot.setTitle(SvgPlot.PlotDesignation.GLOBAL, title);
        for (double[] xx : getSupportPoints()) {
            final int n = xx.length;
            double[] xdata = new double[n];
            double[] ydata = new double[n];
            for (int i = 0; i < n; i++) {
                Date d = new Date((long) xx[i]);
                xdata[i] = unitConversion(x, getQuantity(d, x));
                ydata[i] = unitConversion(y, getQuantity(d, y));
            }
            plot.addData(xdata, ydata);
        }
        for (Wpt wpt : pts) {
            for (Date d : timeWpt(wpt, 0.01)) {
                try {
                    plot.addPoint(unitConversion(x, getQuantity(d, x)),
                            unitConversion(y, getQuantity(d, y)), wpt.getName());
                } catch (Exception err) {
                    System.err.println("Warning: Cannot plot Wpt:");
                    System.err.println(wpt.getName());
                    System.err.println(wpt.getLon());
                    System.err.println(wpt.getLat());
                    DateFormat df = new SimpleDateFormat(GPSDings.ISO_DATE
                            + "'Z'");
                    df.setTimeZone(GPSDings.UTC);
                    System.err.println(df.format(d));
                    System.err.println(err);
                }
            }
        }
       
        plot.setTitle(SvgPlot.PlotDesignation.X, getAxisTitle(x));
        plot.setTitle(SvgPlot.PlotDesignation.Y, getAxisTitle(y));
       
        return plot;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.