dankelley / oce

R package for oceanographic processing
http://dankelley.github.io/oce/
GNU General Public License v3.0
142 stars 42 forks source link

plot,section-method(ztype="points") isn't drawing points in the right place #2195

Closed richardsc closed 7 months ago

richardsc commented 7 months ago

Example below (from the Ancillary Examples).

     library(oce)
     data(section)
     GS <- subset(section, 113<=stationId&stationId<=129)
     GSg <- sectionGrid(GS, p=seq(0, 2000, 100))

     # Gulf Stream, salinity data and contoured
     plot(GS, which=1, ylim=c(2000, 0), ztype="points",
          zbreaks=seq(0,30,2), pch=20, cex=3)

produces:

image
dankelley commented 7 months ago

This is related to #2194 and I'll be posting a fix within an hour. (Tests take a long time.)

dankelley commented 7 months ago

I think this is okay now -- see commit note below.

commit 03bdfbc27897603a0f0c4a04213b90ce4572894e Author: dankelley kelley.dan@gmail.com Date: Thu Feb 22 09:32:23 2024 -0400

improve plot.section() (issues 2194 and 2195)

I think I have both #2194 and #2195 working now, in the "develop" branch
of oce.

Please update oce, and then, if you have time, please also pull the
oce-issues repo, glance at the R file to see what it will do (it creates
72 png files) and then let it create those file by typing

    cd 21xx/2194
    make

It would help a lot if you could then browse those 72 PNG files.

Do you see any problems with them?  If so, please report the file name,
which will save me some time.

What I'm really looking for is blank plot areas, etc. It should only
take 2 minutes to look at each PNG for 2 seconds.  Not too long, given
the importance of getting sections working again!

PS. I see a way to improve the speed for ztype="points" by a factor of
order N, where N is the number of stations.  But I've not coded that,
because I don't want to break anything (taking me an hour to fix) just
to save a user 4 seconds or whatever.  I might do that fix on a weekend,
though.
dankelley commented 7 months ago

Forgot to say -- I also ran the 'ancillary examples' part of the ?plot.section docs and they seem okay. Maybe you can check them, though, Clark.

I'd like to have some assurance that I've fixed this and #2194, because the code is (sort of) "in my head" now and it's easier to fix things in such a state.

I'm not sure when these problems came into play, but I do recall that there was a change that had some other desirable qualities, so with these new fixes, the code ought to work better and to be better-tested.

richardsc commented 7 months ago

I just ran the tests for #2194, and re-ran the example from above, and all looks good. Thanks! 😄