Silverfrost Forums

Welcome to our forums

%pl[link=columns]

18 Aug 2025 10:34 #32289

Paul, one for you to look at time permitting.

When using %[link=columns], if the range of the y data is such that the value for y_min automatically selected by %pl is not 0 for scale=linear, or 1 for scale=log_linear, a rather messy plot is produced, with the columns extending into the margins.

This is easily fixed if y_min is explicitly set by the programmer – in which case the columns are “clipped” at y_min.

New users, might conclude the link=columns does not work correctly if their data generates plots similar to Graph 2 and Graph 4 produced by the code below:

https://www.dropbox.com/scl/fi/jnukshlor3gnzx7f7f003/Screenshot-2025-08-18-112530.jpg?rlkey=i20f5t2swysybdfpus6atgr9n&st=v5i3xw1l&dl=0

program ex18
use clrwin
implicit none
integer, parameter :: n = 20
real*8 :: x(n), y2(n)
  integer :: i, iw
  x = [(i,i=1,n)]
  y2 = 100.d0/x
  print*, minval(y2), 10.d0**floor(log10(minval(y2)))

  call winop@('%pl[n_graphs=1,frame,width=5,x_array]')
  call winop@('%pl[link=columns,scale=linear]')
  call winop@('%pl[Title='Graph 1']')
  iw = winio@('%pl&',300,300,n,x,y2)
  
  call winop@('%pl[n_graphs=1,frame,width=5,x_array]')
  call winop@('%pl[link=columns,scale=linear]')
  call winop@('%pl[Title='Graph 2']')
  iw = winio@('%pl&',300,300,5,x,y2(1:5))
  
  call winop@('%pl[n_graphs=1,frame,width=5,x_array]')
  call winop@('%pl[link=columns,scale=linear,y_min=19]')
  call winop@('%pl[Title='Graph 3']')
  iw = winio@('%pl&',300,300,5,x,y2(1:5))
  
  call winop@('%pl[n_graphs=1,frame,width=5,x_array]')
  call winop@('%pl[link=columns,scale=log_linear]')
  call winop@('%pl[Title='Graph 4']')
  iw = winio@('%ff%pl&',300,300,n,x,y2)
  
  call winop@('%pl[n_graphs=1,frame,width=5,x_array]')
  call winop@('%pl[link=columns,scale=log_linear,y_min=0.1]')
  call winop@('%pl[Title='Graph 5']')
  iw = winio@('%pl&',300,300,n,x,y2)
  
  call winop@('%pl[n_graphs=1,frame,width=5,x_array]')
  call winop@('%pl[link=columns,scale=log_linear,y_min=4.9]')
  call winop@('%pl[Title='Graph 6']')
  iw = winio@('%pl',300,300,n,x,y2)
end program ex18 
18 Aug 2025 3:54 #32290

Thanks Ken. I will add this to the list.

22 Aug 2025 7:08 #32297

This has now been fixed.

I guess that, for columns one would routinely provide y_min so I have only corrected the base of the column to be the current y-axis value whatever it happens to be.

Please login to reply.