Silverfrost Forums

Welcome to our forums

%pl - suppress tick-numbers ?

3 Sep 2018 3:15 #22506

Hello everyone, with some efforts my progam draws the following plot :

[img]https://postimg.cc/gallery/dha7zr7q/

The only unbeautiful thing is, that the tick-numbers lay in the space of the figure. Has anybody an idea to prevent these tick-numbers? My intensive search in the forum to find a solution failed, sadly.

3 Sep 2018 4:09 #22507

The %pl option [external_ticks] might be relevant.

4 Sep 2018 10:23 #22511

John,

Whether or not it is the case here (about the ticks being different lengths) such effects may be the result of converting real coordinates into integer pixel coordinates. In the worst case, you can be out by a pixel at each end, and this shows up on a low resolution device like a screen, but not on a high resolution printer.

A further advantage of using the graphics primitives is that you can fill areas in colour.

Eddie

4 Sep 2018 3:45 #22514

Some additional comments to my plot: The shown plot is a part of a program to calculate the stress limit of an reinforced concrete cross section. This program works with an right orientated, three-dimensional x-y-z-coordinate-system, where the x-axis is the longitudinal axis of a girder and the cross section lays into the y-z-plane. This means for a top view of the cross section, that the positive y-axis runs from left to right and the positive z-axis from up to down. The origin of the coordinate-system lays in the middle of the upper edge of the cross-section. All input- and output-data of the program is done in this coordinate-system. To keep these settings for drawing the cross-section as shown, the y-data is plotted in x-direction and the z-data in (-y)-direction. In doing so the numerical data in both directions is correct, except the sign for the y-direction. I've tried already a version with z-data in (+y)-direction - no problem after an equivalent coordinate transformation. But then the x-axis and the origin too is at the bottom of the cross-section. Now the numerical data in x-direction is correct indeed, but in y-direction the the numerical data runs from down to up. For the program user is this confusingly.

Here the extract of my actual source-code of the drawing part: All data is available and specified correctly.

[color=green][/color]
!C opening the plot-window,  Drawing a XY Graph
      iw0=winio@('%sp&',plox,ployo)
      iw0=winio@('%pv%aw&',ctrl0)
      iw0=winio@('%ww[no_border]&')
      iw0=winio@('%`bg[white]&')
      iw0=winio@('%ca[Querschnitt und Bewehrungen]&')
      CALL winop@('%pl[external_ticks]')
      CALL winop@('%pl[y_min=-2.01,y_max=0.01]')
      CALL winop@('%pl[x_min=-0.5,x_max=+0.5]')
      CALL winop@('%pl[dx=0.1,dy=0.1]')
      CALL winop@('%pl[gridlines]')
      CALL winop@('%pl[x_array]')
      CALL winop@('%pl[independent]')
       CALL winop@('%pl[n_graphs=2]')
       iw0=winio@('%pl',plopix,plopiy, &
          NP2,xData(1:np2(1),1),yData(1:np2(1),1),xData(1:np2(2),2),yData(1:np2(2),2))
       
!C  axis-labels
      CALL draw_characters@('Querschnittsbreite [m]',ihx,ivx,RGB@(0,0,0))
      CALL rotate_font@(wi90)
      CALL draw_characters@('Querschnittshöhe [m]',ihy,ivy,RGB@(0,0,0))
      CALL rotate_font@(wi00)
!C  legends
      CALL draw_filled_rectangle@(reh1,rev1,reh2,rev2,RGB@(0,0,0))
      CALL draw_polyline@(ibqh,ibv1,2,RGB@(0,0,0))
      CALL draw_characters@(LEGE(KB)(1:LG(KB)),ib1,ivv0,RGB@(0,0,0))
      ...... and so on

Still a remark to the y-axis settings: The settings CALL winop@('%pl[y_min=-2.0,y_max=0.0]') causes, that the lines and symbols, which are laying on the border/frame directly, are clipped. Only the part inside frame is drawn. This was in Version 8.1 not the case!

My question again: Is it possible to prevent the tick-numbers of both axes? Then I couldt set my own tick-numbers outside the frame e.g. with CALL draw_characters@ .

5 Sep 2018 3:23 #22515

John, I've tried your proposal and replaced [external_ticks] with [frame]. Many thanks, it works!

The only defect is the negative sign of the numbers in y-direction.

I also work with MATLAB. There exist the possibility to manipulate the numbers of axes-labels in the following easy way:

[color=red:6687f54851]ytlab=get(gca,'YtickLabel'); [my1,my2]=size(ytlab); ytlab(my1,1:my2)=' '; !!sets the first sign to 'blanc' set(gca,'YtickLabel',ytlab,'YtickMode','manual'); xtlab=get(gca,'XtickLabel'); [my1,my2]=size(xtlab); xtlab(my1,1:my2)=' '; !!sets the first sign to 'blanc' set(gca,'XtickLabel',xtlab,'XtickMode','manual');

[/color:6687f54851]I hope the code is self-explanatory; gca means 'get current axis'

My question at the experts: Exists a similar way in the used fortran too?

6 Sep 2018 12:56 #22517

My recommendation would be to use %gr, rather than %pl. You would have much more flexibility with layouts. Just divide the annotation tasks up and write routines for each task. It has to be easier that trying to contort the problem to being a graph. It should not too hard to draw a grid; draw a section; draw reio bars; draw shear bars; annotate section etc. Start small then add features to each routine.

7 Sep 2018 6:10 #22519

John-Silver

If you have simple code that illustrates these 'simple bugs' then please post the code so that they can be fixed.

8 Sep 2018 6:44 #22520

John

If you can provide new short and simple programs that illustrate these 'faults' one at a time then I will try to find time to look at them. You will have to make it easy for me. There are too many other demands on my time.

Please login to reply.