-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-42741: Make focalPlaneGeometryPlot look a bit better #203
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
|
||
from ...interfaces import KeyedData, KeyedDataSchema, PlotAction, Scalar, Vector | ||
from ...math import nanMax, nanMedian, nanMin, nanSigmaMad | ||
from .plotUtils import addPlotInfo, sortAllArrays | ||
from .plotUtils import addPlotInfo, mkColormap, sortAllArrays | ||
|
||
|
||
class FocalPlanePlot(PlotAction): | ||
|
@@ -382,6 +382,10 @@ def makePlot( | |
fig : `matplotlib.figure.Figure` | ||
The resulting figure. | ||
""" | ||
|
||
cmap = mkColormap(["midnightBlue", "lightcyan", "darkgreen"]) | ||
cmap.set_bad(color="none") | ||
|
||
if plotInfo is None: | ||
plotInfo = {} | ||
|
||
|
@@ -530,14 +534,23 @@ def makePlot( | |
bbox = dict(facecolor="paleturquoise", alpha=0.5, edgecolor="none") | ||
ax.text(0.8, 0.91, statsText, transform=fig.transFigure, fontsize=8, bbox=bbox) | ||
|
||
patchCollection = PatchCollection(patches, alpha=0.4, edgecolor="black") | ||
patchCollection.set_array(values) | ||
# Defaults to med + 4 sigma Mad to match | ||
# the camera team plots | ||
if self.plotMin is not None: | ||
currentLimits = patchCollection.get_clim() | ||
patchCollection.set_clim(self.plotMin, currentLimits[1]) | ||
vmin = self.plotMin | ||
else: | ||
vmin = statMed - 4.0 * statMad | ||
if self.plotMax is not None: | ||
currentLimits = patchCollection.get_clim() | ||
patchCollection.set_clim(currentLimits[0], self.plotMax) | ||
vmax = self.plotMax | ||
else: | ||
vmax = statMed + 4.0 * statMad | ||
|
||
valuesPlot = np.clip(values, vmin, vmax) | ||
|
||
patchCollection = PatchCollection( | ||
patches, edgecolor="white", cmap=cmap, linewidth=0.5, linestyle=(0, (0.5, 3)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it be too much to make these options (e.g., edgecolor, linewidth...) configurable too, or is it not worth it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer not to make all of these things configurable. I would like the plots produced to be uniform and not clutter up the code with too many config options. |
||
) | ||
patchCollection.set_array(valuesPlot) | ||
ax.add_collection(patchCollection) | ||
|
||
divider = make_axes_locatable(ax) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there 3 options here, and could we add "tableau-colorblind10"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The three work together to make the colormap, I do want to move all the plots over to a coloublind friendly set of palates, if these ones aren't already, but I would prefer to change all the plots at once.