<s> import numpy as np <EOL> from vispy import app , gloo <EOL> from vispy . visuals . collections import SegmentCollection <EOL> c = app . Canvas ( size = ( <NUM_LIT> , <NUM_LIT> ) , show = True , keys = '<STR_LIT>' ) <EOL> gloo . set_viewport ( <NUM_LIT:0> , <NUM_LIT:0> , c . size [ <NUM_LIT:0> ] , c . size [ <NUM_LIT:1> ] ) <EOL> gloo . set_state ( "<STR_LIT>" , depth_test = False ) <EOL> segments = SegmentCollection ( "<STR_LIT>" , linewidth = "<STR_LIT>" ) <EOL> n = <NUM_LIT:100> <EOL> P0 = np . dstack ( <EOL> ( np . linspace ( <NUM_LIT:100> , <NUM_LIT> , n ) , np . ones ( n ) * <NUM_LIT:50> , np . zeros ( n ) ) ) . reshape ( n , <NUM_LIT:3> ) <EOL> P0 = <NUM_LIT:2> * ( P0 / ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1> ) ) - <NUM_LIT:1> <EOL> P1 = np . dstack ( <EOL> ( np . linspace ( <NUM_LIT> , <NUM_LIT> , n ) , np . ones ( n ) * <NUM_LIT> , np . zeros ( n ) ) ) . reshape ( n , <NUM_LIT:3> ) <EOL> P1 = <NUM_LIT:2> * ( P1 / ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1> ) ) - <NUM_LIT:1> <EOL> segments . append ( P0 , P1 , linewidth = np . linspace ( <NUM_LIT:1> , <NUM_LIT:8> , n ) ) <EOL> segments [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> segments [ '<STR_LIT>' ] = <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT> <EOL> @ c . connect <EOL> def on_draw ( e ) : <EOL> gloo . clear ( '<STR_LIT>' ) <EOL> segments . draw ( ) <EOL> @ c . connect <EOL> def on_resize ( e ) : <EOL> width , height = e . size [ <NUM_LIT:0> ] , e . size [ <NUM_LIT:1> ] <EOL> gloo . set_viewport ( <NUM_LIT:0> , <NUM_LIT:0> , width , height ) <EOL> segments [ '<STR_LIT>' ] = <NUM_LIT:0> , <NUM_LIT:0> , width , height <EOL> app . run ( ) </s>
