Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D line plot bug/inconsistency #49

Open
ja72 opened this issue Oct 7, 2024 · 2 comments
Open

3D line plot bug/inconsistency #49

ja72 opened this issue Oct 7, 2024 · 2 comments

Comments

@ja72
Copy link

ja72 commented Oct 7, 2024

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
@kookma
Copy link
Owner

kookma commented Oct 8, 2024

Would you mind creating a PR?

@ja72
Copy link
Author

ja72 commented Oct 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants