diff --git a/src/python/visclaw/data.py b/src/python/visclaw/data.py index 413c739..2f98223 100644 --- a/src/python/visclaw/data.py +++ b/src/python/visclaw/data.py @@ -656,7 +656,7 @@ def __init__(self, name, plotfigure): self.add_attribute('afteraxes',None) self.add_attribute('xlimits',None) self.add_attribute('ylimits',None) - self.add_attribute('skip_patches_outside_xylimits',True) + self.add_attribute('skip_patches_outside_xylimits',None) self.add_attribute('scaled',False) # true so x- and y-axis scaled same self.add_attribute('image',False) # true so x- and y-axis scaled same # and plot bounds tight diff --git a/src/python/visclaw/frametools.py b/src/python/visclaw/frametools.py index e8a7a86..8c0bb23 100644 --- a/src/python/visclaw/frametools.py +++ b/src/python/visclaw/frametools.py @@ -186,6 +186,21 @@ def plot_frame(framesolns,plotdata,frameno=0,verbose=False): beforeaxes = getattr(plotaxes,'beforeaxes',None) current_data = run_str_or_func(beforeaxes,current_data) + skip_patches_outside_xylimits = plotaxes.skip_patches_outside_xylimits + + if skip_patches_outside_xylimits is None: + # User didn't set. Set to True unless there's a mapped grid + + mapped_grid_exists = (plotdata.mapc2p is not None) + if not mapped_grid_exists: + # check every item in case there's a mapc2p: + for itemname in plotaxes._itemnames: + plotitem = plotaxes.plotitem_dict[itemname] + mapped_grid_exists = mapped_grid_exists or \ + (plotitem.mapc2p is not None) + + skip_patches_outside_xylimits = not mapped_grid_exists + # NOTE: This was rearranged December 2009 to # loop over patches first and then over plotitems so that @@ -206,10 +221,9 @@ def plot_frame(framesolns,plotdata,frameno=0,verbose=False): # loop over patches: # ---------------- - num_skipped = 0 - skip_patches_outside_xylimits = \ - getattr(plotaxes,'skip_patches_outside_xylimits',True) + num_skipped = 0 + for stateno,state in enumerate(framesoln.states): patch = state.patch