def dislinPlot(xvals, yvals, ylimit): # Set the plot output file format dislin.metafl(plot_filetype) # Dislin routine initialization dislin.disini() # Set the font type on graph dislin.complx() # Set the Graph color dislin.color(plot_color) # Fix the position of axes on graph area dislin.axspos(axes_pos_x, axes_pos_y) # Fix the length of axes on graph area dislin.axslen(axes_len_l, axes_len_h) # Set name of axes dislin.name(x_axis_name, 'X') dislin.name(y_axis_name, 'Y') # Num of digits after decimal point ; "-2" refers automatic selection dislin.labdig(-2, 'X') # Num of ticks on axes b/w values dislin.ticks(x_axis_ticks, 'X') dislin.ticks(y_axis_ticks, 'Y') # Plot title text dislin.titlin('y_axis_name vs x_axis_name', 1) # Plot details; xlower., xupper., x1stlabel., xstep., ylower., yupper., y1stlabel., ystep dislin.graf(0., float(data_samples), 0., float(x_step), 0., float(ylimit), 0., float(y_step)) # Write title on plot dislin.title() # Curve changes if called multiple times dislin.chncrv('NONE') # Plot the Curve dislin.curve(xvals, yvals, data_samples) # Dislin routine conclusion dislin.disfin()
def myplot(id): xa = -180. xe = 180. xor = -180. xstp = 60. ya = -90. ye = 90. yor = -90. ystp = 30. isel = dislin.gwglis(id_lis) dislin.setxid(id_draw, 'widget') dislin.metafl('xwin') dislin.disini() dislin.erase() dislin.complx() if (isel >= 4 and isel <= 7): dislin.noclip() elif (isel == 2): ya = -85 ye = 85 yor = -60 elif (isel >= 8 and isel <= 10): ya = 0 ye = 90 yor = 0 dislin.labdig(-1, 'xy') dislin.name('Longitude', 'x') dislin.name('Latitude', 'y') dislin.projct(cl2[isel - 1]) dislin.titlin(cl1[isel - 1] + 'Projection', 3) dislin.htitle(50) dislin.grafmp(xa, xe, xor, xstp, ya, ye, yor, ystp) dislin.title() dislin.gridmp(1, 1) dislin.color('green') dislin.world() dislin.unit(0) dislin.disfin()
dislin.complx() dislin.axspos(450, 1800) dislin.axslen(2200, 1200) dislin.name('X-axis', 'X') dislin.name('Y-axis', 'Y') dislin.labdig(-1, 'X') dislin.ticks(10, 'XY') dislin.titlin('Demonstration of CURVE', 1) dislin.titlin('Legend', 3) dislin.graf(0., 360., 0., 90., -1., 1., -1., 0.5) dislin.title() dislin.chncrv('LINE') dislin.curve(x, y1, n) dislin.curve(x, y2, n) cbuf = ' ' dislin.legini(cbuf, 2, 7) # cbuf is a dummy parameter for python nx = dislin.nxposn(190.) ny = dislin.nyposn(0.75) dislin.leglin(cbuf, 'sin (x)', 1) dislin.leglin(cbuf, 'cos (x)', 2) dislin.legpos(nx, ny) dislin.legtit('Legend') dislin.legend(cbuf, 3) dislin.disfin()