- Timestamp:
- Aug 11, 2016 6:22:16 AM (8 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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- b2f21e0d
- Parents:
- 09d6719
- Location:
- src/sas/sasgui/plottools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/PlotPanel.py
r09d6719 r8abd96d 1223 1223 if prop["ylabel"]: 1224 1224 self.subplot.set_ylabel(r"$%s$"%prop["ylabel"]) 1225 if prop["xlim"] is not None:1226 self.subplot.set_xlim(prop["xlim"])1227 if prop["ylim"] is not None:1228 self.subplot.set_ylim(prop["ylim"])1229 1225 self.subplot.set_title(prop["title"]) 1230 1226 … … 1767 1763 _yscale = 'linear' 1768 1764 for item in list: 1769 set_ylim = False # Whether to set ylim based on data points or error bars1770 1765 item.setLabel(self.xLabel, self.yLabel) 1771 1766 # control axis labels from the panel itself … … 1827 1822 self.graph._yaxis_transformed("1/%s" % yname, "%s" % yunits) 1828 1823 if self.yLabel == "y*x^(2)": 1829 set_ylim = True1830 1824 item.transformY(transform.toYX2, transform.errToYX2) 1831 1825 xunits = convert_unit(4, self.xaxis_unit) … … 1833 1827 "%s%s" % (yunits, xunits)) 1834 1828 if self.yLabel == "y*x^(4)": 1835 set_ylim = True1836 1829 item.transformY(transform.toYX4, transform.errToYX4) 1837 1830 xunits = convert_unit(4, self.xaxis_unit) … … 1864 1857 self.graph._yaxis_transformed("%s \ \ %s^{4}" % (yname, xname), 1865 1858 "%s%s" % (yunits, xunits)) 1866 if self.viewModel == "Guinier lny vs x^(2)":1867 item.transformX(transform.toX2, transform.errToX2)1868 xunits = convert_unit(2, xunits)1869 self.graph._xaxis_transformed("%s^{2}" % xname, "%s" % xunits)1870 item.transformY(transform.toLogX, transform.errToLogX)1871 self.graph._yaxis_transformed("\ln\ \ %s" % yname, "%s" % yunits)1872 if self.viewModel == "Porod y*x^(4) vs x^(4)":1873 item.transformX(transform.toX4, transform.errToX4)1874 xunits = convert_unit(4, self.xaxis_unit)1875 self.graph._xaxis_transformed("%s^{4}" % xname, "%s" % xunits)1876 item.transformY(transform.toYX4, transform.errToYX4)1877 self.graph._yaxis_transformed("%s \ \ %s^{4}" % (yname, xname),1878 "%s%s" % (yunits, xunits))1879 1859 item.transformView() 1880 if set_ylim:1881 self.graph.ylim((min(item.view.y), max(item.view.y)))1882 else:1883 self.graph.ylim(None)1884 1860 1885 1861 # set new label and units -
src/sas/sasgui/plottools/plottables.py
rf2f6af9 r8abd96d 157 157 self.prop["xunit_base"] = units 158 158 159 def xlim(self, xlim):160 """161 Set the limits of the x axis to (min, max).162 """163 self.prop["xlim"] = xlim164 165 159 def yaxis(self, name, units): 166 160 """ … … 173 167 self.prop["ylabel_base"] = name 174 168 self.prop["yunit_base"] = units 175 176 def ylim(self, ylim):177 """178 Set the limits of the y axis to (min, max).179 """180 self.prop["ylim"] = ylim181 169 182 170 def title(self, name): … … 278 266 self.prop = {"xlabel": "", "xunit": None, 279 267 "ylabel": "", "yunit": None, 280 "xlim": None, "ylim": None,281 268 "title": ""} 282 269 self.plottables = {} -
src/sas/sasgui/plottools/transform.py
rd7bb526 r8abd96d 291 291 292 292 293 def errToYX2( x, y, dx=None, dy=None):293 def errToYX2(y, x, dy=None, dx=None): 294 294 """ 295 295 """ … … 325 325 326 326 327 def errToLogYX2( x, y, dx=None, dy=None):327 def errToLogYX2(y, x, dy=None, dx=None): 328 328 """ 329 329 calculate error of Log(yx**2) … … 375 375 376 376 377 def errToLogYX4( x, y=None, dx=None, dy=None):377 def errToLogYX4(y, x, dy=None, dx=None): 378 378 """ 379 379 error for ln(y*x^(4)) … … 396 396 397 397 398 def errToYX4( x, y=None, dx=None, dy=None):398 def errToYX4(y, x, dy=None, dx=None): 399 399 """ 400 400 error for (y*x^(4))
Note: See TracChangeset
for help on using the changeset viewer.