From c549bfb77119c22c66ca92e077f0b0eb555f6ca0 Mon Sep 17 00:00:00 2001 From: Ian Giestas Pauli Date: Tue, 3 May 2022 12:29:29 -0300 Subject: [PATCH] (feature) Set each axis range individually. 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). --- src/ogpf.f90 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/ogpf.f90 b/src/ogpf.f90 index 92ff64d..05ec8c3 100644 --- a/src/ogpf.f90 +++ b/src/ogpf.f90 @@ -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 @@ -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)