From glasspusher at outofoptions.net Fri Jan 10 11:53:36 2020 From: glasspusher at outofoptions.net (Dave) Date: Fri, 10 Jan 2020 09:53:36 -0800 Subject: [proFit-list] script to add stuff to a legend In-Reply-To: <535EF840-3675-4A0F-8976-30C2932237F9@quansoft.com> References: <535EF840-3675-4A0F-8976-30C2932237F9@quansoft.com> Message-ID: <9617C804-4F6D-4C0C-ABE9-F658BBF817CC@outofoptions.net> Hi, I finally got around to trying this, and I suppose I see the bug. I?m using 7.0.14. The text gets drawn to the left of the legend symbols, and the only way to get them to draw in the correct position is go in and click on each legend in the plots pane of the graph settings dialog. It also renders the text in a bigger size than the original legend. I did it with a python script: for r in range(6): pf.SetPlotProperties(plot = r + 1, name = pf.GetData(r+1,1)) > On Oct 10, 2019, at 7:41 PM, pro Fit support wrote: > > >> On Oct 9, 2019, at 8:27 PM, Dave > wrote: >> >> Hi all, >> >> I?m looking to modify a set of labels to curves in a legend. Rather than edit the text for each curve in the legend individually, is there a way script it to say insert or replace text in each curve legend with a set of comma or space delimited text to go to each entry? >> >> Thanks for any and all >> >> Dave Sopchak >> _______________________________________________ >> proFit-list mailing list >> proFit-list at quantum-soft.com >> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com > > > Dear Dave, > > what you can do is write a script to change the name of each curve in the graph, and this will then change the name in the legend. > > Let?s say you put the new name for all curves in your plot in the furst column of the current data window (set it to be of type text) and that you want to transfer those names to the curves in the current graph. Here a simple script that would do just that for the first two curves in the current graph (you can also write the same thing in python if you prefer): > > program changenames; > var i:integer; > begin > for i:=1 to 2 do > begin > SetPlotProperties(plot i, name GetCell(i,1)); > end; > end; > > The only issue is that after you have run this script in pro Fit version 7.0.14 or earlier you have to do the additional final step of selecting the legend and changing the font size to force an update. But this is fixed in pro FIt 7.0.15, which we are just about to release. > > all the best, > ? > pro Fit support > profit at quansoft.com > > > > > > _______________________________________________ > proFit-list mailing list > proFit-list at quantum-soft.com > http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From profit at quansoft.com Sat Jan 11 20:45:30 2020 From: profit at quansoft.com (pro Fit support) Date: Sat, 11 Jan 2020 21:45:30 -0500 Subject: [proFit-list] script to add stuff to a legend In-Reply-To: <9617C804-4F6D-4C0C-ABE9-F658BBF817CC@outofoptions.net> References: <535EF840-3675-4A0F-8976-30C2932237F9@quansoft.com> <9617C804-4F6D-4C0C-ABE9-F658BBF817CC@outofoptions.net> Message-ID: Hi Dave, yes, that?s right, that?s exactly the bug we fixed in 7.0.15 - just go to quansoft.com/down.html and download it! ivan ? pro Fit support profit at quansoft.com > On Jan 10, 2020, at 12:53 PM, Dave wrote: > > Hi, > I finally got around to trying this, and I suppose I see the bug. I?m using 7.0.14. The text gets drawn to the left of the legend symbols, and the only way to get them to draw in the correct position is go in and click on each legend in the plots pane of the graph settings dialog. It also renders the text in a bigger size than the original legend. > > I did it with a python script: > > for r in range(6): > pf.SetPlotProperties(plot = r + 1, name = pf.GetData(r+1,1)) > > > >> On Oct 10, 2019, at 7:41 PM, pro Fit support > wrote: >> >> >>> On Oct 9, 2019, at 8:27 PM, Dave > wrote: >>> >>> Hi all, >>> >>> I?m looking to modify a set of labels to curves in a legend. Rather than edit the text for each curve in the legend individually, is there a way script it to say insert or replace text in each curve legend with a set of comma or space delimited text to go to each entry? >>> >>> Thanks for any and all >>> >>> Dave Sopchak >>> _______________________________________________ >>> proFit-list mailing list >>> proFit-list at quantum-soft.com >>> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com >> >> >> Dear Dave, >> >> what you can do is write a script to change the name of each curve in the graph, and this will then change the name in the legend. >> >> Let?s say you put the new name for all curves in your plot in the furst column of the current data window (set it to be of type text) and that you want to transfer those names to the curves in the current graph. Here a simple script that would do just that for the first two curves in the current graph (you can also write the same thing in python if you prefer): >> >> program changenames; >> var i:integer; >> begin >> for i:=1 to 2 do >> begin >> SetPlotProperties(plot i, name GetCell(i,1)); >> end; >> end; >> >> The only issue is that after you have run this script in pro Fit version 7.0.14 or earlier you have to do the additional final step of selecting the legend and changing the font size to force an update. But this is fixed in pro FIt 7.0.15, which we are just about to release. >> >> all the best, >> ? >> pro Fit support >> profit at quansoft.com >> >> >> >> >> >> _______________________________________________ >> proFit-list mailing list >> proFit-list at quantum-soft.com >> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com > > _______________________________________________ > proFit-list mailing list > proFit-list at quantum-soft.com > http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From glasspusher at outofoptions.net Tue Feb 11 08:14:58 2020 From: glasspusher at outofoptions.net (Dave) Date: Tue, 11 Feb 2020 06:14:58 -0800 Subject: [proFit-list] deleting columns (or rows) in a function Message-ID: <22F109C3-5596-4086-962E-38D66987C3D8@outofoptions.net> Hi, Is there a way to programmatically delete columns (what I?m interested in right now) or rows from a data window in a Python script? Dave From slasley at space.umd.edu Tue Feb 11 12:23:29 2020 From: slasley at space.umd.edu (Scott Lasley) Date: Tue, 11 Feb 2020 13:23:29 -0500 Subject: [proFit-list] deleting columns (or rows) in a function In-Reply-To: <22F109C3-5596-4086-962E-38D66987C3D8@outofoptions.net> References: <22F109C3-5596-4086-962E-38D66987C3D8@outofoptions.net> Message-ID: pf.DeleteColumns(window = , at = , count = ) or pf.DeleteRows(window = , at = , count = ) will delete count= columns or rows starting at position at= . For example, if you have a data window named MyData and want to delete columns 3 and 4, use pf.DeleteColumns(window='MyData', at=3, count=2) This will delete the columns, so the columns to the right of the last deleted column will shift left to "fill in the hole" and their indexes will change. If you just want to remove the data in a column you can use pf.SelectColumn(window = , column = , fromColumn = , toColumn = , options = ) and pf.Clear() pf.SelectColumn(window='MyData', firstColumn=3, lastColumn=4, options='forgetOld') pf.Clear(window='MyData') Or loop over the rows and use pf.ClearData(row, col) after setting the current window pf.SetCurrentWindow('MyData') for row in pf.RowRange(): pf.ClearData(row, 3) pf.ClearData(row, 4) Scott > On Feb 11, 2020, at 9:14 AM, Dave wrote: > > Hi, > Is there a way to programmatically delete columns (what I?m interested in right now) or rows from a data window in a Python script? > > Dave From glasspusher at outofoptions.net Tue Feb 11 12:29:57 2020 From: glasspusher at outofoptions.net (Dave) Date: Tue, 11 Feb 2020 10:29:57 -0800 Subject: [proFit-list] deleting columns (or rows) in a function In-Reply-To: References: <22F109C3-5596-4086-962E-38D66987C3D8@outofoptions.net> Message-ID: <5394F0CB-CFE8-40E1-BBA1-E24E5AC06DD1@outofoptions.net> Awesome! I did not see these. They were in the ?accessing data? popup menu, I was looking in ?window/files? Thanks. > On Feb 11, 2020, at 10:23 AM, Scott Lasley wrote: > > pf.DeleteColumns(window = , at = , count = ) or pf.DeleteRows(window = , at = , count = ) will delete count= columns or rows starting at position at= . For example, if you have a data window named MyData and want to delete columns 3 and 4, use > > pf.DeleteColumns(window='MyData', at=3, count=2) > > This will delete the columns, so the columns to the right of the last deleted column will shift left to "fill in the hole" and their indexes will change. If you just want to remove the data in a column you can use pf.SelectColumn(window = , column = , fromColumn = , toColumn = , options = ) and pf.Clear() > > pf.SelectColumn(window='MyData', firstColumn=3, lastColumn=4, options='forgetOld') > pf.Clear(window='MyData') > > Or loop over the rows and use pf.ClearData(row, col) after setting the current window > > pf.SetCurrentWindow('MyData') > for row in pf.RowRange(): > pf.ClearData(row, 3) > pf.ClearData(row, 4) > > Scott > >> On Feb 11, 2020, at 9:14 AM, Dave wrote: >> >> Hi, >> Is there a way to programmatically delete columns (what I?m interested in right now) or rows from a data window in a Python script? >> >> Dave > > > _______________________________________________ > proFit-list mailing list > proFit-list at quantum-soft.com > http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com From jan.lagerwall at uni.lu Thu Feb 13 03:02:39 2020 From: jan.lagerwall at uni.lu (Jan LAGERWALL) Date: Thu, 13 Feb 2020 09:02:39 +0000 Subject: [proFit-list] Can I fit a function to data with asymmetric errors? Message-ID: <421E5F59-D784-4324-914B-591839D6864A@uni.lu> Hi all, I am fitting an equation to data that has quite large errors at one end of the measuring range and considering the error estimates is essential to getting good results. A problem is, however, that it seems fitting always assumes symmetric errors. My y-values are volume fractions, which obviously cannot be greater than 1, but as I approach volume fraction 1, my estimated errors are on the order of 0.2 or 0.3. This means that a value of 0.9 is considered going from, say, 0.7 to 1.1 during fitting, but of course values greater than 1.0 do not make sense. In another data set, I have x-values that I know are lower estimates. In other words, here I would like to set x-error downwards equals zero but the error upwards can be significant. I can plot the data with asymmetric error bars, but I cannot find a way to tell the fitting algorithm to consider asymmetric errors. Am I missing something here, or did I misunderstand something fundamental about how the fitting works, or can I tweak the fitting so asymmetric errors are being considered? Thanks a lot! /Jan Dr. Jan P. F. Lagerwall Professor Department of Physics and Materials Science Universit? du Luxembourg Campus Limpertsberg 162a, avenue de la Fa?encerie, BS 1.15a L-1511 Luxembourg T +352 46 66 44 6219 F +352 46 66 44 36219 Jan.Lagerwall at uni.lu /www.lcsoftmatter.com physics.uni.lu, www.uni.lu -------------- next part -------------- An HTML attachment was scrubbed... URL: From profit at quansoft.com Sat Feb 15 15:38:23 2020 From: profit at quansoft.com (pro Fit support) Date: Sat, 15 Feb 2020 16:38:23 -0500 Subject: [proFit-list] Can I fit a function to data with asymmetric errors? In-Reply-To: <421E5F59-D784-4324-914B-591839D6864A@uni.lu> References: <421E5F59-D784-4324-914B-591839D6864A@uni.lu> Message-ID: <15A07CF3-1F59-42E8-BCA8-E2A502B23BB1@quansoft.com> Hi Jan, (note that your message was blocked by the list server because it thinks you are not a subscriber, but I let it go manually because of potential general interest. You might want to subscribe to get access to the list in the future.) Yes, the absence of a fit algorithm for asymmetric errors is a missing feature. In fact, most standard algorithm for curve fitting do not use asymmetric errors. One way around your problem is to use the largest between the two error values when doing the fit, and then confirm that the fitted function is generally on that side of the data once the fit is finished, and you can also compare the fits obtained when using either the smaller of the two errors or the larger, and then pick the fit that ?makes sense?. You could also hand-program a calculation for the squared deviations that checks which side of the data function the function value is and uses a different error value depending on the result, and then use this to compare ?fit quality? between the various results. The other way around the problem is to use your own hand-programed squared deviation function that contains your simulation function, access your data, and contains if-conditions for using the correct errors to find the sum of the square deviations that needs to be minimized. You would then use the ?Optimize?? feature to find a minimum that would then correspond to the optimum set of parameters that fits the asymmetric error data. This might be a bit of an overkill if you get satisfactory results with the imperfect methods I suggested above. ivan ? pro Fit support profit at quansoft.com > On Feb 13, 2020, at 4:02 AM, Jan LAGERWALL wrote: > > Hi all, > > I am fitting an equation to data that has quite large errors at one end of the measuring range and considering the error estimates is essential to getting good results. A problem is, however, that it seems fitting always assumes symmetric errors. My y-values are volume fractions, which obviously cannot be greater than 1, but as I approach volume fraction 1, my estimated errors are on the order of 0.2 or 0.3. This means that a value of 0.9 is considered going from, say, 0.7 to 1.1 during fitting, but of course values greater than 1.0 do not make sense. > > In another data set, I have x-values that I know are lower estimates. In other words, here I would like to set x-error downwards equals zero but the error upwards can be significant. I can plot the data with asymmetric error bars, but I cannot find a way to tell the fitting algorithm to consider asymmetric errors. > > Am I missing something here, or did I misunderstand something fundamental about how the fitting works, or can I tweak the fitting so asymmetric errors are being considered? > > Thanks a lot! > /Jan > > > > Dr. Jan P. F. Lagerwall > Professor > Department of Physics and Materials Science > > Universit? du Luxembourg > > Campus Limpertsberg > 162a, avenue de la Fa?encerie, BS 1.15a > L-1511 Luxembourg > > T +352 46 66 44 6219 > F +352 46 66 44 36219 > Jan.Lagerwall at uni.lu /www.lcsoftmatter.com > physics.uni.lu , www.uni.lu > > > > > > > _______________________________________________ > proFit-list mailing list > proFit-list at quantum-soft.com > http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From slasley at space.umd.edu Sat Feb 15 15:44:05 2020 From: slasley at space.umd.edu (Scott Lasley) Date: Sat, 15 Feb 2020 16:44:05 -0500 Subject: [proFit-list] Can I fit a function to data with asymmetric errors? In-Reply-To: <421E5F59-D784-4324-914B-591839D6864A@uni.lu> References: <421E5F59-D784-4324-914B-591839D6864A@uni.lu> Message-ID: <42605412-A11A-413F-8064-FA15EEF52EA0@space.umd.edu> This may not be helpful, but the stackoverflow answer from DanHickstein mentions that the PAIDA python package can do fits with asymmetric weighting. https://stackoverflow.com/questions/19116519/scipy-optimize-curvefit-asymmetric-error-in-fit http://paida.sourceforge.net/documentation/fitter/index.html http://paida.sourceforge.net/documentation/fitter/sampleFitter_asymmetric.py I've never used PAIDA and it was last updated in 2007 so I'm not sure how well, or even if, it works with current python versions and libraries. The last entry in this google gnuplot forum mentions using the simplex algorithm https://groups.google.com/forum/#!topic/comp.graphics.apps.gnuplot/9435qi8L-yE Finally, google found this on stackoverflow. See the "Update on asymmetric errors" section https://stackoverflow.com/questions/46832659/python-power-law-fit-with-upper-limits-asymmetric-errors-in-data-using-odr > On Feb 13, 2020, at 4:02 AM, Jan LAGERWALL wrote: > > Hi all, > > I am fitting an equation to data that has quite large errors at one end of the measuring range and considering the error estimates is essential to getting good results. A problem is, however, that it seems fitting always assumes symmetric errors. My y-values are volume fractions, which obviously cannot be greater than 1, but as I approach volume fraction 1, my estimated errors are on the order of 0.2 or 0.3. This means that a value of 0.9 is considered going from, say, 0.7 to 1.1 during fitting, but of course values greater than 1.0 do not make sense. > > In another data set, I have x-values that I know are lower estimates. In other words, here I would like to set x-error downwards equals zero but the error upwards can be significant. I can plot the data with asymmetric error bars, but I cannot find a way to tell the fitting algorithm to consider asymmetric errors. > > Am I missing something here, or did I misunderstand something fundamental about how the fitting works, or can I tweak the fitting so asymmetric errors are being considered? > > Thanks a lot! > /Jan > > > > Dr. Jan P. F. Lagerwall > Professor > Department of Physics and Materials Science > > Universit? du Luxembourg > > Campus Limpertsberg > 162a, avenue de la Fa?encerie, BS 1.15a > L-1511 Luxembourg > > T +352 46 66 44 6219 > F +352 46 66 44 36219 > Jan.Lagerwall at uni.lu /www.lcsoftmatter.com > physics.uni.lu, www.uni.lu