forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%pl - suppress tick-numbers ?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
FK_GER



Joined: 26 Oct 2017
Posts: 22
Location: University of Kassel,Germany

PostPosted: Mon Sep 03, 2018 4:15 pm    Post subject: %pl - suppress tick-numbers ? Reply with quote

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.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5459
Location: Salford, UK

PostPosted: Mon Sep 03, 2018 5:09 pm    Post subject: Reply with quote

The %pl option [external_ticks] might be relevant.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 885

PostPosted: Tue Sep 04, 2018 3:11 am    Post subject: Reply with quote

Paul, the Y-axis and the 2 'boxed sides' of the graph frame do produce ticks on the outside (see the graph below) so I assume EXTERNAL_TICKS is already specified.
It's the x-axis, which has the ticks internal which I think you're referring to isn't it FK_GER ?
The y values are all negative and it looks like you've set the y-axis length to be slightly longer than the section height so that the frame at the bottom doesn't overlay on the dotted section profile ?

Why not make y-values all positive and the plot should come out ok with the x-axis at the bottom of the frame ?
The y-axis labelling would be better on the outside also.
I seem to remember that can be done too with an option.

ah yes ....
I assume you used:
Quote:
[framed] Adds a box with tick marks as a frame.

but if you use:-
Quote:
[frame] Like [framed] but draws the xy-axis caption and tick values outside of the frame

you'll probably get what you want. Give it a try.
Ah the joys of 2 options with almost the same name ! Smile
I think it still plots the axes but all labels will be on the outside.u'he 've done that with t
I see you've got your 'Gerschnnitshone' well placed outside the frame and I assume you did that using something like:
[y_axis=Gerschnnitwotsit@(-n,-p)]
That probably won't be necessary if you use the [frame] option, or at least it will reduce the offset to the 'intended for small adjustments' range which Paul always reminds us about.

[Note - Paul - seeing these labels reminds me, have you thought of your technique for producing a specific Deutchland version of %PL to cope with the germanic propensity for long words ? :O) In the past I've seen A4 powerpoint presentations with words the full width of the page ! so imagin the problems that might be incured with axs labels and totles :O) :O) :O)]

I'm still surprised FK_GER that you didn't use the CLEARWIN 'primitives' (simply lots of 'Lžnes' in this case) as a few people suggested on your original post to generate the drawing, but I'm sure you've got your good reasons or putting yourself through the 'torture' of using %PL to do it !
___________________

Possible Bug ... or my eyes?
Paul - it may be my eyes but zooming in on the graph below, to me the ticks on the right hand side of the box look longer than on the other edges !!!!
The lower frame edge also appears to be thicker than on the other sides ?
Something just to check maybe ?
___________________

Posting the Postimage Link (for FK_GER)
FKGER ... the form of the link you posted is incorrect.
The link you posted is actually the link of the webpage and there should be [url] at the beginning AND [/url] at the end (NOT[IMG]), so then you'd get the hyperlink appearing like this:-
https://postimg.cc/image/dhoqwfuhh/

To get the image to appear on the post directly you need to use the link provided on the Postimage page. Click on 'Share' and the links will pop up.
Use the next to bottom one 'Hotlink for Forums'.
As DanRRight has previously noted, you actually don't need the outer [URL] bits, you can just use the part of the link within the '[IMG]' and '[/img]' (inclusive of those tags).
Using either, you'll get the image to appear as here:-


_________________
''Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant. Together they should be powerful beyond imagination. But ...''


Last edited by John-Silver on Sat Sep 08, 2018 11:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1824
Location: Yateley, Hants, UK

PostPosted: Tue Sep 04, 2018 11:23 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
FK_GER



Joined: 26 Oct 2017
Posts: 22
Location: University of Kassel,Germany

PostPosted: Tue Sep 04, 2018 4:45 pm    Post subject: Reply with quote

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.
Code:
[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@ .
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 885

PostPosted: Tue Sep 04, 2018 6:16 pm    Post subject: Reply with quote

KL, you've used [external_ticks] which implies [framed] i.e. it's assumed as a consequence.
Try replacing the option [external _ticks] with [frame] ( no 'd' !) and you should get what you want. I think !

John
_________________
''Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant. Together they should be powerful beyond imagination. But ...''


Last edited by John-Silver on Sat Sep 08, 2018 11:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 885

PostPosted: Tue Sep 04, 2018 6:17 pm    Post subject: Reply with quote

KL, you've used [external_ticks] which implies [framed] i.e. it's assumed as a consequence.
Try replacing the option [external _ticks] with [frame] ( no 'd' !) and you should get what you want. I think !

John
_________________
''Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant. Together they should be powerful beyond imagination. But ...''
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 885

PostPosted: Tue Sep 04, 2018 6:19 pm    Post subject: Reply with quote

Eddie, tick lengths are defined in pixels so no rounding should occur.
However, it does depend on where the frame edge lines are držawn relative to the 'points' (pixels) defining them.
Logically, a line with an odd number of pixels thickness shouldbe centred arond the 'pixel line' (i.e. symmetric). For even numbers of pixels thicknesses the line can't be put symmetrically about the points (pixels) so there will be 1 pixel offset. Now, if the rh and lh frame edges are offset by one pixel the 'same side' of their respective lines then when ticks are drawn on one side they will appear to be a pixel different. In fact they're not, they're just an extra pixel hidden by the thickness of the line on one side.

There's another possibility and that is that the lines are always drawn completely (except 1 pixel) to one side of the points (pixels) line). That would make the diference in tick lengths APPEAR much more different.
The best way is to draw the frame edges as 'mirror reflections'. i.e. whatever the offset philosophy the left hand frame line should be offset towards the outside (to the left of the nominal pixel line, and the rh one similarly offset thžo the rh side of it's pixel line.
Of course that gobbledy gook I've just written needs a diagram ! but I'm lazy this evening Smile

Paul could confirm how the lines are actually drawn as of today to confirm this 'theory'.

It shouldn't be that difficult to change.
Seeing what I saw in that graph is disconcerting. It could be worse for other frame line thickness (much thicker).
_________________
''Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant. Together they should be powerful beyond imagination. But ...''
Back to top
View user's profile Send private message
FK_GER



Joined: 26 Oct 2017
Posts: 22
Location: University of Kassel,Germany

PostPosted: Wed Sep 05, 2018 4:23 pm    Post subject: Reply with quote

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:

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');

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?
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1971
Location: Sydney

PostPosted: Thu Sep 06, 2018 1:56 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 885

PostPosted: Thu Sep 06, 2018 10:32 pm    Post subject: Reply with quote

KL - To my knowledge there are no fancy manipulative command sequences like the example you quote
BUT ...
TRY setting the ticks spacing [dy=yy] (and/or [dy=yy] - see below) to be GREATER THAN the height of the section (i.e.the whole range of the vertical axis) !
Then if it works you should get no tick marks, or probably just the one at the origin) (and hence no labels) at all and you can DRAW_CHARACTERS to your hearts content to create your own axes ticks and labels.

... fingers crossed it works Smile

Much depends on how the internals of native %PL work since I don't think there's a way to fix the size of the actual graph area so it might try to accomodate in some way with peculiar results as a consequence.

There's only one way and that's to try it and see !
.........................................
If that works you could then do the same for the other axis, so then you can harmonise your self-label styles on both axes (rather than hit and miss trying to match the auto-generated ones on the horizontal axis)
Why there might also be scope for generating in some clever way an overlay plot of your resulting stresses over the section itself ! (needing at least 2 figures of course to get the stresses in 2 directions. But that sort of cunning possibility is for another days thinking I'd say Smile
__________________________

In the medium term when %PL work picks up again, and once the simple bugs have been sorted, Paul could consider adding to the %PL wishlist, or not, the ability to:-

a) option to suppress all ticks/labels if desired (similar to how we can currently select to not plot axes captions

b) option to choose the orientation of the plot on screen including the option to have non-Maxwell axes !!! (i.e just one axis 'flipped' about the other (which would be convenient for what you want here I think).
_________________
''Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant. Together they should be powerful beyond imagination. But ...''
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5459
Location: Salford, UK

PostPosted: Fri Sep 07, 2018 7:10 am    Post subject: Reply with quote

John-Silver

If you have simple code that illustrates these "simple bugs" then please post the code so that they can be fixed.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 885

PostPosted: Fri Sep 07, 2018 11:49 pm    Post subject: Reply with quote

I'm surprised you don't remember them Paul.
You just have to go through all the Native %pl posts (I think there are 3) to see them, with the various codes posted there by several people.

Why not start by getting the x-axis labels to always be centred.
Or the log scales to be 'fool-proof'. For example.

I did suggest at one point that we needed some kind of 'running list' of outstanding bugs to be maintained. But it fell on deaf ears at the time as I rmember.

Do you have time on your hands to deploy some effort in that direction now then is that what you're telling us?

Maybe we should have a dedicated Native 'Native %PL Bug Fixes' post to centralise them on?

Of course it all depends on the definition of 'simple bugs' for you doesn't it.

Oh, what about the regular overlay of y-axis captions over the tick labels (depending on th format of those labels for example.

Or a really simple one - whydoesn't the origin (0) of the co-ordinate syatem always get labelled.
I could go on
How do you want to organise this, bcause it needs some organising or we'll run round in circles again I'm sure and be back here in 6 or 12 months time.

There should really be 2 lists of course - bug fixes and a 'wish list' for enhancements (e.g. user-defined 'reversed axis' definition KL's problem)
_________________
''Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant. Together they should be powerful beyond imagination. But ...''
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5459
Location: Salford, UK

PostPosted: Sat Sep 08, 2018 7:44 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 885

PostPosted: Sat Sep 08, 2018 11:17 pm    Post subject: Reply with quote

I'll see what I can do
_________________
''Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant. Together they should be powerful beyond imagination. But ...''
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group