How to view vertical zoom in Sequencer with Python?

I know with ctrl + middle mouse button I can view vertical zoom , but how do I do this in python?

• To be able to view the current settings, this needs to be done without operators. For the 3d view, this information is held in, and can be set from 'context.area.spaces[0].region_3d' , but the space for the sequencer seems to have no equivalent. – Snu Oct 23 '18 at 0:37

This will zoom in on the y:

layout.operator_context = "EXEC_REGION_WIN"
zoom = layout.operator("view2d.zoom", text="Zoom Y")
zoom.deltay=1


I guess that it is somehow connected to "bpy.ops.sequencer.view_ghost_border", but nothing happens when using that function(Click the "Zoom Y " button in the sequencer header menu):

import bpy

def MyFunction(context):
if not bpy.context.scene.sequence_editor: #create sequence, if missing
bpy.context.scene.sequence_editor_create()

bpy.ops.sequencer.view_ghost_border(gesture_mode=0, xmin=0, xmax=200, ymin=0, ymax=200)

class MyOperator(bpy.types.Operator):
'''Tooltip for MyOperator'''
bl_idname = "object.my_operator"
bl_label = "My Operator"
bl_options = {"REGISTER", "UNDO"}

@classmethod
def poll(cls, context):
if context.object != None:
return context.object.select
return False

def execute(self, context):

MyFunction(context)
return {'FINISHED'}

def invoke(self, context, event):
return self.execute(context)

self.layout.operator(MyOperator.bl_idname, "Zoom Y")

def register():
bpy.utils.register_module(__name__)