Changeset 9a5097c in sasview for src/sas/sasgui/plottools/plottables.py
- Timestamp:
- Mar 26, 2017 11:33:16 PM (7 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ed2276f
- Parents:
- 9146ed9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/plottables.py
ra9f579c r9a5097c 43 43 # Support for ancient python versions 44 44 import copy 45 import numpy 45 import numpy as np 46 46 import sys 47 47 import logging … … 706 706 self.dy = None 707 707 if not has_err_x: 708 dx = n umpy.zeros(len(x))708 dx = np.zeros(len(x)) 709 709 if not has_err_y: 710 dy = n umpy.zeros(len(y))710 dy = np.zeros(len(y)) 711 711 for i in range(len(x)): 712 712 try: … … 796 796 tempdy = [] 797 797 if self.dx == None: 798 self.dx = n umpy.zeros(len(self.x))798 self.dx = np.zeros(len(self.x)) 799 799 if self.dy == None: 800 self.dy = n umpy.zeros(len(self.y))800 self.dy = np.zeros(len(self.y)) 801 801 if self.xLabel == "log10(x)": 802 802 for i in range(len(self.x)): … … 826 826 tempdy = [] 827 827 if self.dx == None: 828 self.dx = n umpy.zeros(len(self.x))828 self.dx = np.zeros(len(self.x)) 829 829 if self.dy == None: 830 self.dy = n umpy.zeros(len(self.y))830 self.dy = np.zeros(len(self.y)) 831 831 if self.yLabel == "log10(y)": 832 832 for i in range(len(self.x)): … … 859 859 tempdy = [] 860 860 if self.dx == None: 861 self.dx = n umpy.zeros(len(self.x))861 self.dx = np.zeros(len(self.x)) 862 862 if self.dy == None: 863 self.dy = n umpy.zeros(len(self.y))863 self.dy = np.zeros(len(self.y)) 864 864 if xmin != None and xmax != None: 865 865 for i in range(len(self.x)): … … 1228 1228 1229 1229 def sample_graph(): 1230 import numpy as n x1230 import numpy as np 1231 1231 1232 1232 # Construct a simple graph 1233 1233 if False: 1234 x = n x.array([1, 2, 3, 4, 5, 6], 'd')1235 y = n x.array([4, 5, 6, 5, 4, 5], 'd')1236 dy = n x.array([0.2, 0.3, 0.1, 0.2, 0.9, 0.3])1234 x = np.array([1, 2, 3, 4, 5, 6], 'd') 1235 y = np.array([4, 5, 6, 5, 4, 5], 'd') 1236 dy = np.array([0.2, 0.3, 0.1, 0.2, 0.9, 0.3]) 1237 1237 else: 1238 x = n x.linspace(0, 1., 10000)1239 y = n x.sin(2 * nx.pi * x * 2.8)1240 dy = n x.sqrt(100 * nx.abs(y)) / 1001238 x = np.linspace(0, 1., 10000) 1239 y = np.sin(2 * np.pi * x * 2.8) 1240 dy = np.sqrt(100 * np.abs(y)) / 100 1241 1241 data = Data1D(x, y, dy=dy) 1242 1242 data.xaxis('distance', 'm')
Note: See TracChangeset
for help on using the changeset viewer.