Changeset d6d411d in sasview
- Timestamp:
- Jul 21, 2008 2:05:25 PM (16 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:
- 6aaf444
- Parents:
- be72312c
- Location:
- guitools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/PlotPanel.py
r8800ff6 rd6d411d 746 746 747 747 for item in list: 748 print item.name 748 print item.name, self.xLabel, item.get_xaxis() 749 749 item.setLabel(self.xLabel,self.yLabel) 750 750 if ( self.xLabel=="x" ): 751 751 item.transformX(transform.toX,transform.errToX) 752 752 name, units = item.get_xaxis() 753 self.graph. xaxis("%s" % name, "%s" % units)753 self.graph._xaxis_transformed("%s" % name, "%s" % units) 754 754 755 755 … … 758 758 name, units = item.get_xaxis() 759 759 units=convertUnit(2,units) 760 self.graph. xaxis("%s^{2}" % name, "%s" % units)760 self.graph._xaxis_transformed("%s^{2}" % name, "%s" % units) 761 761 762 762 … … 765 765 _xscale = 'log' 766 766 name, units = item.get_xaxis() 767 self.graph. xaxis("\log_{10}\ \ (%s)" % name, "%s" % units)767 self.graph._xaxis_transformed("\log_{10}\ \ (%s)" % name, "%s" % units) 768 768 769 769 … … 771 771 item.transformY(transform.toLogX,transform.errToLogX) 772 772 name, units = item.get_yaxis() 773 self.graph. yaxis("\log\ \ %s" % name, "%s" % units)773 self.graph._yaxis_transformed("\log\ \ %s" % name, "%s" % units) 774 774 775 775 … … 777 777 item.transformY(transform.toX,transform.errToX) 778 778 name, units = item.get_yaxis() 779 self.graph. yaxis("%s" % name, "%s" % units)779 self.graph._yaxis_transformed("%s" % name, "%s" % units) 780 780 781 781 … … 784 784 _yscale = 'log' 785 785 name, units = item.get_yaxis() 786 self.graph. yaxis("\log_{10}\ \ (%s)" % name, "%s" % units)786 self.graph._yaxis_transformed("\log_{10}\ \ (%s)" % name, "%s" % units) 787 787 788 788 … … 791 791 name, units = item.get_yaxis() 792 792 units=convertUnit(2,units) 793 self.graph. yaxis("%s^{2}" % name, "%s" % units)793 self.graph._yaxis_transformed("%s^{2}" % name, "%s" % units) 794 794 795 795 … … 798 798 name, units = item.get_yaxis() 799 799 units=convertUnit(-1,units) 800 self.graph. yaxis("1/%s" % name, "%s" % units)800 self.graph._yaxis_transformed("1/%s" % name, "%s" % units) 801 801 802 802 if ( self.yLabel =="1/sqrt(y)" ): … … 804 804 name, units = item.get_yaxis() 805 805 units=convertUnit(-0.5,units) 806 self.graph. yaxis("1/\sqrt{%s}" %name, "%s" % units)806 self.graph._yaxis_transformed("1/\sqrt{%s}" %name, "%s" % units) 807 807 808 808 if ( self.yLabel =="ln(y*x)"): … … 810 810 yname, yunits = item.get_yaxis() 811 811 xname, xunits = item.get_xaxis() 812 self.graph. yaxis("\log\ (%s \ \ %s)" % (yname,xname), "%s%s" % (yunits,xunits))812 self.graph._yaxis_transformed("\log\ (%s \ \ %s)" % (yname,xname), "%s%s" % (yunits,xunits)) 813 813 814 814 … … 818 818 xname, xunits = item.get_xaxis() 819 819 xunits = convertUnit(2,xunits) 820 self.graph. yaxis("\log (%s \ \ %s^{2})" % (yname,xname), "%s%s" % (yunits,xunits))820 self.graph._yaxis_transformed("\log (%s \ \ %s^{2})" % (yname,xname), "%s%s" % (yunits,xunits)) 821 821 822 822 … … 826 826 xname, xunits = item.get_xaxis() 827 827 xunits = convertUnit(4,xunits) 828 self.graph. yaxis("\log (%s \ \ %s^{4})" % (yname,xname), "%s%s" % (yunits,xunits))828 self.graph._yaxis_transformed("\log (%s \ \ %s^{4})" % (yname,xname), "%s%s" % (yunits,xunits)) 829 829 830 830 if ( self.viewModel == "Guinier lny vs x^(2)"): … … 833 833 name, units = item.get_xaxis() 834 834 units = convertUnit(2,units) 835 self.graph. xaxis("%s^{2}" % name, "%s" % units)835 self.graph._xaxis_transformed("%s^{2}" % name, "%s" % units) 836 836 837 837 838 838 item.transformY(transform.toLogX,transform.errToLogX ) 839 839 name, units = item.get_yaxis() 840 self.graph. yaxis("\log\ \ %s" % name, "%s" % units)840 self.graph._yaxis_transformed("\log\ \ %s" % name, "%s" % units) 841 841 842 842 -
guitools/plottables.py
ra17ffdf rd6d411d 116 116 would be nice. 117 117 """ 118 def _xaxis_transformed(self, name, units): 119 """ 120 Change the property of the x axis 121 according to an axis transformation 122 (as opposed to changing the basic properties) 123 """ 124 self.prop["xlabel"] = "%s (%s)"%(name,units) 125 self.prop["xunit"] = units 126 127 def _yaxis_transformed(self, name, units): 128 """ 129 Change the property of the y axis 130 according to an axis transformation 131 (as opposed to changing the basic properties) 132 """ 133 self.prop["ylabel"] = "%s (%s)"%(name,units) 134 self.prop["yunit"] = units 135 118 136 def xaxis(self,name,units): 119 137 """Properties of the x axis. 120 138 """ 121 if self.prop["xunit"] and units != self.prop["xunit"]:122 pass123 #print "Plottable: how do we handle non-commensurate units"124 139 self.prop["xlabel"] = "%s (%s)"%(name,units) 125 140 self.prop["xunit"] = units 141 self.prop["xlabel_base"] = "%s (%s)"%(name,units) 142 self.prop["xunit_base"] = units 126 143 127 144 def yaxis(self,name,units): 128 145 """Properties of the y axis. 129 146 """ 130 if self.prop["yunit"] and units != self.prop["yunit"]:131 pass132 #print "Plottable: how do we handle non-commensurate units"133 147 self.prop["ylabel"] = "%s (%s)"%(name,units) 134 148 self.prop["yunit"] = units 149 self.prop["ylabel_base"] = "%s (%s)"%(name,units) 150 self.prop["yunit_base"] = units 135 151 136 152 def title(self,name):
Note: See TracChangeset
for help on using the changeset viewer.