The following warnings occurred:
Warning [2] Trying to access array offset on value of type null - Line: 4475 - File: inc/functions.php PHP 8.0.30 (Linux)
File Line Function
/inc/functions.php 4475 errorHandler->error
/inc/class_session.php 505 my_strlen
/inc/class_session.php 360 session->create_session
/inc/class_session.php 75 session->load_guest
/global.php 55 session->init
/printthread.php 17 require_once
Warning [2] Undefined variable $mybb - Line: 183 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 183 errorHandler->error
/printthread.php 63 makeprintablenav
Warning [2] Attempt to read property "settings" on null - Line: 183 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 183 errorHandler->error
/printthread.php 63 makeprintablenav
Warning [2] Trying to access array offset on value of type null - Line: 183 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 183 errorHandler->error
/printthread.php 63 makeprintablenav
Warning [2] Undefined variable $forums - Line: 183 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 183 errorHandler->error
/printthread.php 63 makeprintablenav
Warning [2] Undefined variable $mybb - Line: 183 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 183 errorHandler->error
/printthread.php 187 makeprintablenav
/printthread.php 63 makeprintablenav
Warning [2] Attempt to read property "settings" on null - Line: 183 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 183 errorHandler->error
/printthread.php 187 makeprintablenav
/printthread.php 63 makeprintablenav
Warning [2] Trying to access array offset on value of type null - Line: 183 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 183 errorHandler->error
/printthread.php 187 makeprintablenav
/printthread.php 63 makeprintablenav
Warning [2] Undefined variable $forums - Line: 183 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 183 errorHandler->error
/printthread.php 187 makeprintablenav
/printthread.php 63 makeprintablenav
Warning [2] Undefined array key 3 - Line: 184 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 184 errorHandler->error
/printthread.php 187 makeprintablenav
/printthread.php 63 makeprintablenav
Warning [2] Trying to access array offset on value of type null - Line: 1229 - File: inc/functions.php PHP 8.0.30 (Linux)
File Line Function
/inc/functions.php 1229 errorHandler->error
/printthread.php 72 forum_permissions
Warning [2] Trying to access array offset on value of type null - Line: 1229 - File: inc/functions.php PHP 8.0.30 (Linux)
File Line Function
/inc/functions.php 1229 errorHandler->error
/printthread.php 72 forum_permissions
Warning [2] Undefined array key "canonlyviewownthreads" - Line: 78 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 78 errorHandler->error
Warning [2] Undefined array key "page" - Line: 86 - File: printthread.php PHP 8.0.30 (Linux)
File Line Function
/printthread.php 86 errorHandler->error
Warning [2] Undefined array key 0 - Line: 1023 - File: inc/class_parser.php PHP 8.0.30 (Linux)
File Line Function
/inc/class_parser.php 1023 errorHandler->error
/inc/class_parser.php 1041 postParser->mycode_parse_img
[PHP]   postParser->mycode_parse_img_callback1
/inc/class_parser.php 392 preg_replace_callback
/inc/class_parser.php 155 postParser->parse_mycode
/printthread.php 156 postParser->parse_message
Warning [2] Undefined variable $css_align - Line: 1029 - File: inc/class_parser.php PHP 8.0.30 (Linux)
File Line Function
/inc/class_parser.php 1029 errorHandler->error
/inc/class_parser.php 1041 postParser->mycode_parse_img
[PHP]   postParser->mycode_parse_img_callback1
/inc/class_parser.php 392 preg_replace_callback
/inc/class_parser.php 155 postParser->parse_mycode
/printthread.php 156 postParser->parse_message
Warning [2] Undefined variable $multipage - Line: 24 - File: printthread.php(163) : eval()'d code PHP 8.0.30 (Linux)
File Line Function
/printthread.php(163) : eval()'d code 24 errorHandler->error
/printthread.php 163 eval



jWork.ORG forums
Insufficient accuracy on tick mark labels on HPlot - Printable Version

+- jWork.ORG forums (https://jwork.org/forum)
+-- Forum: DataMelt (/forumdisplay.php?fid=1)
+--- Forum: DataMelt bug report (/forumdisplay.php?fid=3)
+--- Thread: Insufficient accuracy on tick mark labels on HPlot (/showthread.php?tid=77)



Insufficient accuracy on tick mark labels on HPlot - reichold - 09-11-2015 03:33 AM

Please excuse formatting blunders, its the first time I use this forum.

The small Java example code below produces a large number of points of a sinusoidal function, stores them in a P1D and that gets displayed via an HPlot.

If you zoom on the horizontal axis into the area beyond 1E6 until you see only a few oscillations you will notice that the tick mark labels on the horizontal axis all show the same number and the axis gets automatically labelled with a scale factor of 10^6. (see the attached picture) I.e. there is not sufficient accuracy to display the tickmarks once the numbers are displayed in scientific or exponential notation.

Could somebody tell me how I can increase the accuracy (number of significant digits) of axis tick mark labels in an HPlot ?

regards
Armin

Code:
package plotproblemdemo;

import jhplot.HPlot;
import jhplot.P1D;

public class PlotProblemDemo {

    public static void main(String[] args) {
        // TODO code application logic here
        String p1DName = "My p1D";
        P1D myP1D = new P1D(p1DName);
        myP1D.setLineStyle(1);
        myP1D.setDrawSymbol(false);
        double start = 0;
        double end = 2000000;
        double period = 100;
        double amplitude = 1;
        double y;
        for (double x = start; x <= end; x+=10) {
            y = amplitude * Math.sin(x/period);
            myP1D.add(x, y);
        }
        int width = 900;
        int height = 500;
        String hPlotName = "My HPlot";
        HPlot myHPlot = new HPlot(hPlotName, width, height, 1, 1);
        myHPlot.setRangeX(start, end);
        myHPlot.setRangeY(-(amplitude*1.1),+(amplitude*1.1));
        myHPlot.visible();
        myHPlot.draw(myP1D);
    }
}

[Image: HPlotTickLabelProblem.pdf]



RE: Insufficient accuracy on tick mark labels on HPlot - sergei175 - 09-12-2015 09:01 AM

Hello, Armin

It is usually not recommended to use HPlot when the number of points is so large, since the canvas requires to much memory. Try to use SPlot or HPlotXY.
This example seems works:

Code:
from jhplot import *
from java.lang  import Math

p1DName = "My p1D";
myP1D = P1D(p1DName);
myP1D.setLineStyle(1);
myP1D.setDrawSymbol(False);
start = 0;
end = 2000000;
period = 100;
amplitude = 1;

for x in range(start,end,10):
            y = amplitude * Math.sin(x/period)
            myP1D.add(x, y)
width = 900;
height = 500;
hPlotName = "My HPlot";
# myHPlot = HPlotXY(hPlotName, width, height);
myHPlot = SPlot(hPlotName, width, height);
myHPlot.visible();
myHPlot.setRange(start, end, -(amplitude*1.1), +(amplitude*1.1));
myHPlot.draw(myP1D);