|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2863 Location: South Pole, Antarctica
|
Posted: Thu Jun 23, 2022 11:48 pm Post subject: |
|
|
Davey,
Do you mean exponent like here : cm-3 ? It can be done by shifting it (you also can scale the font a bit lower in size like this
Code: | call SELECT_FONT@('Tahoma') ! Courier New, Terminal etc
call scale_font@(FontSize1)
! call BOLD_FONT@( 1 )
|
and then return size back for other needs. But here it was not have been done) by delta_X. For both draw_line_between or draw_line_betweenD this is done like this
Code: | CALL draw_line_betweenD@(x1+delta_X, y1, x2, y2, icolor ) |
though usually all small defects like that i ignore and just photoshop a bit later. Small editions always needed anyway here and there when you prepare the plot for high level publications. But better to keep the code as small and simple as possible because such subroutines will be reused many times in the future for different plots.
Yes, tics and numbers at the right of the plot are a bit shifted same way as above depending on the font size used. It is possible to make universal code which will correct that automatically if this is the most important plot of your code but usually you just setup the font and put adjustment parameters in special settings which can be called by your click any time later (for not to recompile the code every time).
The number of decimal points in plotted numbers was supposed to be a recent addition to Clearwin, i do not remember if it was added. But probably you can do that in Designer's Mode settings. When we add just one line to your Fortran Clearwin source code specifying any name settings file
Code: | CALL winop@("%pl[file=Multiplot01.set]") |
the DM will automatically appear like an icon in the upper left hand side corner and you will do a hell lot of things with the plot there - i currently always use Designers Mode in all of my plots. It already there in my demo code above, have you tried it? Thanks to Paul, besides adding native PL, this was one greatest simplification and improvement of Clearwin of recent years. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2863 Location: South Pole, Antarctica
|
Posted: Thu Apr 27, 2023 1:39 pm Post subject: |
|
|
If i do this, what is naturally expected, it does not work
Code: | CALL draw_charactersD@(trim(SomeplotText1),
* 30+ixShiftTimesMesh+idx, ! bug ?
* iyShiftTimesMesh + i*idShiftTimesMesh+13.d0, 0) |
and if this - by using double precision pixel coordinate 30.d0 - it works
Code: | CALL draw_charactersD@(trim(SomeplotText1),
* 30.d0+ixShiftTimesMesh+idx, ! bug ?
* iyShiftTimesMesh + i*idShiftTimesMesh+13.d0, 0) |
Strange... |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 709 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Thu Apr 27, 2023 2:29 pm Post subject: |
|
|
Dan,
Assuming the prefix i denotes default integer kind:
Code: | integer :: ixShiftTimesMesh = 10, idx = 1
print*, kind(30+ixShiftTimesMesh+idx) ! KIND = 3 integer
print*, kind(30.d0+ixShiftTimesMesh+idx) ! KIND = 2 real
end |
Both coordinate arguments of draw_charactersD@ must be real, KIND=2 i.e. double precision.
The second coordinate in the argument list is already double precision due to the +13.d0
Ken |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2863 Location: South Pole, Antarctica
|
Posted: Thu Apr 27, 2023 2:50 pm Post subject: |
|
|
Good judgments come from experience, experience comes from bad judgments. Now too much experience makes me bad judgments. Confusing is that previously in graphics library used for all that draw_characters@(ix,iy), draw_line_between@ etc were used integers to position on the screen. Which is now changed.
I made this error several times already. In a year or two i forget and make same error again
How Matlab does not care if this is integer or real ? Is this doable in Fortran ? |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 709 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Thu Apr 27, 2023 3:33 pm Post subject: |
|
|
Code: | !
! If you are going down the route of mixing real, and integer, and
! different kinds for the arguments, perhaps you need something
! like these, but there's a lot of type conversions going on.
!
CALL draw_characters@(trim(SomeplotText1), &
NINT(DBLE(30+ixShiftTimesMesh+idx)), &
NINT(DBLE(iyShiftTimesMesh + i*idShiftTimesMesh+13.d0)), 0)
!
! or
!
CALL draw_charactersD@(trim(SomeplotText1), &
DBLE(30+ixShiftTimesMesh+idx), &
DBLE(iyShiftTimesMesh + i*idShiftTimesMesh+13.d0), 0)
!
! or write your own generic wrapper function say draw_charactersDan
! in a module with appropriate module procedures defined for different
! combinations of real/integer/kinds, which would make the fortran
! code behave like Matlab
! |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8011 Location: Salford, UK
|
Posted: Thu Apr 27, 2023 6:39 pm Post subject: |
|
|
draw_characters@ and draw_line_between@ have not changed. They still take integer co-ordinates. |
|
Back to top |
|
|
|
|
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
|