#1169 Defective Lineplot from Octave

5.0
closed-works-for-me
nobody
None
5
2013-03-01
2012-09-13
mcas125
No

When running the attached Octave script, which plots a polynomial as a bunch of line elements, there appears to be a gap in the produced output plot, after using the Octave Print command. It appears to display correctly on the screen from Octave. It also displays correctly when run on Ubuntu.

My system is running Windows 7 Home Premium SP1/Octave 3.6.2 with MinGW 4.6.2.

Discussion

1 2 > >> (Page 1 of 2)
  • mcas125
    mcas125
    2012-09-13

    Octave Script used to generate plots

     
    Attachments
  • mcas125
    mcas125
    2012-09-13

    Defective Output

     
    Attachments
  • mcas125
    mcas125
    2012-09-13

    Non-defective plot from Ubuntu

     
    Attachments
  • mcas125
    mcas125
    2012-09-13

    Additional example of defective output

     
    Attachments
  • Ethan Merritt
    Ethan Merritt
    2012-09-13

    Thank you for the bug report, but there is not enough information here to work with.

    You've reported the version of Octave, but not the version of gnuplot.
    What gnuplot version[s] are you comparing on Windows and Ubuntu?

    Anyhow, in order to investigate this as a gnuplot bug we will need a set of gnuplot commands that produce an erroneous plot. An Octave script doesn't help much by itself.

     
  • mcas125
    mcas125
    2012-09-15

    I'm now on GNUplot 4.7 (although the included readme still says 4.6.0) . The bug originally appeared with 4.6, but the graphical problems are still showing up in 4.7. I'm not sure the Linux edition of Octave/GNUPlot matters, given that the plot correctly displays in Windows and on Linux in the screen that pops up after the Octave script runs. The only problem is that in trying to EXPORT the image using the print command from octave, the produced jpg/png/eps/whatever has these problems that I've attached. If it truly matters I can find out.

    I'm not sure what partciular gnuplot commands are being called - I'm not an expert on gnuplot. I'm just trying to use it as part of my octave installation. The script I've attached is incredibly simple, but I'm not sure which specific gnuplot commands it's calling.

    If that's not enough information then I guess this bug is unresolvable.

     
  • Dan Sebald
    Dan Sebald
    2012-11-16

    I'll make some comments and observations to see if I can spark any thoughts. I don't have access to Windows; I'm using Linux. Your example plots fine in both X11 term and EPS. So, I'm going to start with real fundamental questions.

    First, are you certain it is gnuplot that is producing the bad plot? There has been work in Octave on graphics for other packages, such as fltk, epstool. Again, I'm clueless on how Windows Octave works, so I'm wondering if perhaps gnuplot is used for the desktop display window, whereas it might be some other package used for the "print" outputs.

    Second, if one plots the points instead of lines:

    plot(xs,ys,'gx');

    the pattern emerges for what has happened. The gaps are missing line segments between multiple points (at the bottom near 1,0) or a single point (at the right near 1.9,0.8). Numbering points left to right, it looks to me like the drawing gets to point number 48, becomes confused and draws a line back to the starting point. Then the drawing starts up again after having dropped some points and then at point number 96 there is another line that draws back to the first point (left-most point) leaving a gap.

    The above might ring a bell in terms of gnuplot's terminal routines for some other developer, but not for me.

    Could you please try reproducing this in Windows without using Octave? Try the following:

    [run gnuplot somehow in Windows and at the command line type]
    set xrange [0:2]
    set samples 100
    plot x**2-2*x+1 with lines
    set term jpeg
    set output 'foo4.jpg'
    replot
    set output
    set term postscript eps
    set output 'foo4.eps'
    replot
    set output
    exit

    and examine plots 'foo4.eps' and 'foo4.jpg' or attach them here.

     
  • Dan Sebald
    Dan Sebald
    2012-11-16

    Another thought came to mind. If it is gnuplot that is drawing these plots with bad line segments, could it be that the package used by gnuplot to create JPEG/PNG/EPS has a bug whereby when the line segment coundt gets to 48 it believes it is to the end of a *closed* segment and draws back to the first point? Why it would think it should be closed, I don't know.

     
  • Steven Darby
    Steven Darby
    2013-02-21

    I can't reproduce those printed plots exactly, but I encounter similar issues with broken or extra lines. I think the problem is with octave and fltk, not with gnuplot. You can make octave use gnuplot by typing
    graphics_toolkit gnuplot
    directly into octave. You could also add the line
    graphics_toolkit('gnuplot');
    to the octaverc file at your_install_dir\share\octave\site\m\startup\octaverc and restart octave.
    This also gives you back the p/n keyboard shortcuts, but I haven't got L to work yet.

     
  • Ethan Merritt
    Ethan Merritt
    2013-03-01

    • labels: 2D plot -->
    • status: open --> closed-works-for-me
    • milestone: --> 5.0
     
1 2 > >> (Page 1 of 2)