Skip to content

Commit

Permalink
(feature) Set each axis range individually.
Browse files Browse the repository at this point in the history
Provides new functions `xlim`, `ylim` and `zlim`.
I haven't tested it, but it should work out of the box since it follows how `set_axis` deals with it.
I also don't know if there is a equivalent `?lim` to that `set_secondary_axis` but I could work on that too if you point me in the right direction.

Sorry for delaying this PR.

PS: It seems the palette code could use some help too (I tried to load a custom one but it seems that is being ignored/overwritten).
  • Loading branch information
14NGiestas authored May 3, 2022
1 parent d2b0322 commit c549bfb
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/ogpf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ module ogpf
procedure, pass, public :: zlabel => set_zlabel
procedure, pass, public :: axis => set_axis
procedure, pass, public :: axis_sc => set_secondary_axis
procedure, pass, public :: xlim => set_xlim
procedure, pass, public :: ylim => set_ylim
procedure, pass, public :: zlim => set_zlim
procedure, pass, public :: filename => set_filename
procedure, pass, public :: reset => reset_to_defaults
procedure, pass, public :: preset => use_preset_configuration
Expand Down Expand Up @@ -366,6 +369,43 @@ subroutine set_options(this,stropt)
end subroutine set_options


subroutine set_xlim(this,rng)
!..............................................................................
!Set the x axis limits in form of [xmin, xmax]
!..............................................................................

class(gpf):: this
real(wp), intent(in) :: rng(2)
this%hasxrange=.true.
this%xrange=rng

end subroutine


subroutine set_ylim(this,rng)
!..............................................................................
!Set the y axis limits in form of [ymin, ymax]
!..............................................................................

class(gpf):: this
real(wp), intent(in) :: rng(2)
this%hasyrange=.true.
this%yrange=rng

end subroutine


subroutine set_zlim(this,rng)
!..............................................................................
!Set the z axis limits in form of [zmin, zmax]
!..............................................................................

class(gpf):: this
real(wp), intent(in) :: rng(2)
this%haszrange=.true.
this%zrange=rng

end subroutine


subroutine set_axis(this,rng)
Expand Down

0 comments on commit c549bfb

Please sign in to comment.