Skip to content

3D line plot bug/inconsistency #49

@ja72

Description

@ja72

To make a 3D line plot the call to lplot3d() does not require the keyword with lines as the regular 2D plot command does.

For example:

    call gp%lplot(x(1,:), x(2,:), x(3,:), 'lt 5 lc rgb "black"')     ! show 3D line plot
    !                                      ^

    call gp%plot(x(1,:), x(2,:), 'with lines lt 5 lc rgb "blue"')    ! show 2D line plot
    !                             ^

But the code above will not work because ogpf.f90 does not insert the required space before with lines in the following lines of code

ogpf/src/ogpf.f90

Line 1402 in 7b414be

pltstring='splot ' // datablock // ' ' // trim(lspec) // 'with lines'

ogpf/src/ogpf.f90

Line 1404 in 7b414be

pltstring='splot ' // datablock // ' notitle '//trim(lspec) // 'with lines'

I propose a fix to make the code look like

         if ( present(lspec) ) then
             if (hastitle(lspec)) then
                 pltstring='splot ' // datablock // ' ' // trim(lspec) // ' with lines'       ! added 1 space in suffix
             else
                 pltstring='splot ' // datablock // ' notitle '//trim(lspec) // ' with lines'    ! added 1 space in suffix
             end if
         else
             pltstring='splot ' // datablock // ' notitle with lines'
         end if

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions