- Timestamp:
- Aug 10, 2016 11:25:57 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:
- 09d6719
- Parents:
- d2fd8fc
- Location:
- src/sas/sasgui/plottools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/PlotPanel.py
rdd5bf63 rf2f6af9 1211 1211 1212 1212 # Properties defined by plot 1213 1213 1214 1214 # Ricardo: 1215 # A empty label "$$" will prevent the panel from displaying! 1216 1215 # A empty label "$$" will prevent the panel from displaying! 1217 1216 if prop["xlabel"]: 1218 1217 self.subplot.set_xlabel(r"$%s$"%prop["xlabel"]) 1219 1218 if prop["ylabel"]: 1220 1219 self.subplot.set_ylabel(r"$%s$"%prop["ylabel"]) 1220 if prop["xlim"] is not None: 1221 self.subplot.set_xlim(prop["xlim"]) 1222 if prop["ylim"] is not None: 1223 self.subplot.set_ylim(prop["ylim"]) 1221 1224 self.subplot.set_title(prop["title"]) 1222 1225 1223 1226 1224 1227 def clear(self): … … 1564 1567 bins=[self.y_bins, self.x_bins], 1565 1568 weights=self.data) 1566 # Now, normalize the image by weights only for weights>1: 1569 # Now, normalize the image by weights only for weights>1: 1567 1570 # If weight == 1, there is only one data point in the bin so 1568 1571 # that no normalization is required. … … 1759 1762 _yscale = 'linear' 1760 1763 for item in list: 1764 set_ylim = False # Whether to set ylim based on data points or error bars 1761 1765 item.setLabel(self.xLabel, self.yLabel) 1762 1763 1766 # control axis labels from the panel itself 1764 1767 yname, yunits = item.get_yaxis() … … 1819 1822 self.graph._yaxis_transformed("1/%s" % yname, "%s" % yunits) 1820 1823 if self.yLabel == "y*x^(4)": 1824 set_ylim = True 1821 1825 item.transformY(transform.toYX4, transform.errToYX4) 1822 1826 xunits = convert_unit(4, self.xaxis_unit) … … 1863 1867 "%s%s" % (yunits, xunits)) 1864 1868 item.transformView() 1869 if set_ylim: 1870 self.graph.ylim((min(item.view.y), max(item.view.y))) 1871 else: 1872 self.graph.ylim(None) 1865 1873 1866 1874 # set new label and units -
src/sas/sasgui/plottools/plottables.py
rcd54205 rf2f6af9 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"] = xlim 164 159 165 def yaxis(self, name, units): 160 166 """ … … 167 173 self.prop["ylabel_base"] = name 168 174 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"] = ylim 169 181 170 182 def title(self, name): … … 266 278 self.prop = {"xlabel": "", "xunit": None, 267 279 "ylabel": "", "yunit": None, 280 "xlim": None, "ylim": None, 268 281 "title": ""} 269 282 self.plottables = {}
Note: See TracChangeset
for help on using the changeset viewer.