kookma / ogpf

ogpf is Object based interface to GnuPlot from Fortran 2003, 2008 and later
Other
167 stars 47 forks source link

3D line plot bug/inconsistency #49

Open ja72 opened 1 week ago

ja72 commented 1 week ago

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

https://github.com/kookma/ogpf/blob/7b414be0d1bdeccc11bd80ed3033a0862468e630/src/ogpf.f90#L1402

https://github.com/kookma/ogpf/blob/7b414be0d1bdeccc11bd80ed3033a0862468e630/src/ogpf.f90#L1404

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 commented 1 week ago

Would you mind creating a PR?

ja72 commented 1 week ago

Yes, sure.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Mohammad Rahmani @.> Sent: Monday, October 7, 2024 11:42:41 PM To: kookma/ogpf @.> Cc: John Alexiou @.>; Author @.> Subject: Re: [kookma/ogpf] 3D line plot bug/inconsistency (Issue #49)

Would you mind creating a PR?

— Reply to this email directly, view it on GitHubhttps://github.com/kookma/ogpf/issues/49#issuecomment-2398733028, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFLXN2OCRTYNZEIFT7AJKJLZ2NIDDAVCNFSM6AAAAABPQSH2XSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJYG4ZTGMBSHA. You are receiving this because you authored the thread.Message ID: @.***>