error in mp.plot concerning meas_color when overlaying >1 measurements

12 views
Skip to first unread message

Aaron Bryant

unread,
Mar 6, 2024, 8:50:21 AM3/6/24
to PDR Toolbox
Hi Marc,

when using ModelPlot.plot (and by extension mp.intensity or mp.ratio), if specifying more than 1 measurement to overlay in parameter space, then an error arises when specifying colors in meas_color.

For example with 2 overlaid measurements, I specify:
meas_color = ['red', 'orange']

from this when doing the mp.plot, I get:
 ValueError: Invalid RGBA argument: 'redred'

This behaviour comes from the "kluge" in ModelPlot._plot_no_wcs at line 850:
colors = kwargs_opts['meas_color'][jj]*mlen

incrementing jj correctly increments through the colors in meas_color, but multiplying by mlen (the kluge for colorcounter), which in this case is 2, would result in:
meas_color = ['red', 'orange']
meas_color[0]*2
Out: 'redred'

Removing the multiplication with mlen fixes this but presumably breaks whatever problem arose with colorcounter.

proof that it works:
Figure 2024-03-06 144928.png

thanks,
Aaron

Marc W. Pound

unread,
Mar 6, 2024, 10:06:41 AM3/6/24
to Aaron Bryant, PDR Toolbox
Hi Aaron

Thanks for this report, I will add it as a github issue.  The problem with kluges is you have to go back and fix them for real!

Marc


--
You received this message because you are subscribed to the Google Groups "PDR Toolbox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdrt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdrt/b253ea35-38d3-4ff3-89bd-28b73160ea5bn%40googlegroups.com.


--
Dr. Marc Pound
Research Scientist
Astronomy Department
University of Maryland, College Park

Marc W. Pound

unread,
Dec 17, 2024, 6:03:22 PM12/17/24
to Aaron Bryant, PDR Toolbox
HI Aaron

This is now fixed for the next release. https://github.com/mpound/pdrtpy/issues/94

best,
Marc


--
You received this message because you are subscribed to the Google Groups "PDR Toolbox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdrt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdrt/b253ea35-38d3-4ff3-89bd-28b73160ea5bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages