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 

Symbols on X-Y Plots ?

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



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Apr 02, 2014 9:57 pm    Post subject: Symbols on X-Y Plots ? Reply with quote

Is it possible any way to ‘easily’ print symbols (e.g. crosses, triangles, squares … filled or unfilled) at data points on an X-Y graph constructed with DRAW_LINE_BETWEEN or DRAW_POLYLINE , or is it necessary to ‘draw’ such symbols using the primitives (lines, elipses, escaped parotts, etc....) ?
I don't find any options in LINE_STYLE routine, only for the line itself
Cheers

John
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Fri Apr 04, 2014 3:30 pm    Post subject: Reply with quote

Even the line style options only really work for 1 pixel wide lines.

You have three options after you have exhausted filled and outlined squares and circles as markers, and they are:

(1) draw the markers with lines - easy ones are + or x crosses, more difficult shapes are possible, and worth coding a subroutine or two for,

(2) draw a bitmap and import or place that with IMPORT_IMAGE@ (there are other related routines too)

(3) draw characters from a font such as Wingdings

Eddie
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat Apr 05, 2014 2:43 am    Post subject: Reply with quote

Thanks ! Obvious really when someone else points it out. Intuitively my mind says the Font option is the simplest(quickest/most reliable. I've already sourced a font which has a series of shapes. Just have to work out carefully how best to centre them on a particular point (via offset of text ref. pt. from data point) . Is there a way to include a particular Font in the program itself, maybe as a Resource File ? Is this then directly referenceable in some way by the program or does it have to be installed on the target computer as part of the installation process ? Maybe it's just a question of indicating that the font needs to be installed on the computer, although that depends on end user action/intelligence, which I believe should be relied upon as little as possible !
Cheers John
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sat Apr 05, 2014 8:41 am    Post subject: Reply with quote

If you use an installation program like Jordan Russell's InnoSetup, you can arrange to have the font installed at the same time as sallflibc.dll and the exe file are installed. You can find the size of the character with GET_TEXT_SIZE@, and then offset it left and down by half that amount, remembering that left is minus and down is plus (always confuses an upper right quadrant enthusiast like myself!). Many fonts have a few symbols anyway.

A long time ago in a computer faraway I decided that labelling contours a, b, c etc caused me fewer spacing and positioning errors than 1, 2, 3 etc, because there are more letters than single numerals, especially if lower and upper cases letters are chosen, and most users recognise the sequence. For that application I made the letters all align on several vertical and horizontal lines through the graphic, as I worked out in my mind that rotating them to align with the contour itself was too much work!

As far as marking nodes with symbols goes, you may or may not need to draw a background-colour rectangle first.

Eddie
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat Apr 05, 2014 6:40 pm    Post subject: Reply with quote

thanks for the pointers Eddie, although you lost me with the relevance of the use of letters to label contours (?)
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sun Apr 06, 2014 10:28 am    Post subject: Reply with quote

Ah, just a ramble because it was raining and I couldn't go out!

Your problem, as I understand it is that you want symbols (say) on a graph where the line changes direction, i.e. at salient points. My previous answer to use one character from a symbol font, and to offset it by half the character height and width so that it is centered over the salient point. So far, so good. What I should have done, perhaps, was to discuss the issue of what size to make the symbols, and what one might do if there are too many too close together, so that the marker symbols overlap, and obscure the line itself

But I was distracted, and when I returned to it, I was thinking about a different problem!

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sun Apr 06, 2014 12:17 pm    Post subject: Reply with quote

Will add that you can also place an icon though that may hiccup and icon sometimes slides to upper left corner and loses ability to be moved with mouse touch and drag (most probably that is due to my own bug somewhere, the simple program doesn't hiccup. Curious if others got the same sometimes)

But in general adding symbols by font manipulation or other ways for 2D graphics in CWP is very powerful and simple. Really increfibly well done.

It is 3D OpenGL where font manipulation and plot marking are the living hell for Fortran users. Very few people so far even touched OpenGL with Fortran. But the trend is that many codes now move to 3D and so the 3D graphics has the future. We need quick and easy solutions here.
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