33#
44# Linear networks
55#
6- # $Revision: 1.97 $ $Date: 2025/11/23 06:47:21 $
6+ # $Revision: 1.98 $ $Date: 2025/12/21 02:34:52 $
77#
88# An object of class 'linnet' defines a linear network.
99# It includes the following components
@@ -222,6 +222,7 @@ plot.linnet <- function(x, ..., main=NULL, add=FALSE,
222222 argh <- list (... )
223223 lines <- as.psp(x )
224224 if (show.vertices ) vert <- vertices(x )
225+ # ' ..........................................................
225226 # ' plan layout and save symbolmaps
226227 RS <- do.call(plot ,
227228 resolve.defaults(list (x = quote(lines ),
@@ -245,34 +246,38 @@ plot.linnet <- function(x, ..., main=NULL, add=FALSE,
245246 } else {
246247 RV <- NULL
247248 }
248- # # initialise plot
249- if (! add ) {
250- args.main <- argh [names(argh ) %in% c(" cex.main" , " adj.main" , " col" )]
251- do.call(plot , append(list (x = quote(B ), type = " n" , main = main ),
252- args.main ))
253- }
254- # # plot segments and (optionally) vertices
255- do.call(plot ,
256- resolve.defaults(list (x = quote(lines ),
257- add = TRUE ,
258- show.window = show.window ,
259- show.all = TRUE ,
260- main = " " ,
261- multiplot = FALSE ),
262- args.segments ,
263- list (... ),
264- list (use.marks = FALSE , legend = FALSE )))
265- if (show.vertices ) {
249+ # ' ---------------- actual plotting ------------------------
250+ if (do.plot ) {
251+ # # initialise plot
252+ if (! add ) {
253+ args.main <- argh [names(argh ) %in% c(" cex.main" , " adj.main" , " col" )]
254+ do.call(plot , append(list (x = quote(B ), type = " n" , main = main ),
255+ args.main ))
256+ }
257+ # # plot segments and (optionally) vertices
266258 do.call(plot ,
267- resolve.defaults(list (x = quote(vert ),
259+ resolve.defaults(list (x = quote(lines ),
268260 add = TRUE ,
269- show.window = FALSE ,
270- show.all = TRUE ,
271- main = " " ),
272- args.vertices ,
261+ show.window = show.window ,
262+ show.all = TRUE ,
263+ main = " " ,
264+ multiplot = FALSE ),
265+ args.segments ,
273266 list (... ),
274267 list (use.marks = FALSE , legend = FALSE )))
268+ if (show.vertices ) {
269+ do.call(plot ,
270+ resolve.defaults(list (x = quote(vert ),
271+ add = TRUE ,
272+ show.window = FALSE ,
273+ show.all = TRUE ,
274+ main = " " ),
275+ args.vertices ,
276+ list (... ),
277+ list (use.marks = FALSE , legend = FALSE )))
278+ }
275279 }
280+ # ' --------- return colour maps and layout ----------------------
276281 result <- list (segments = RS , vertices = RV )
277282 attr(result , " bbox" ) <- B
278283 return (invisible (result ))
0 commit comments