How to use the getdist.plots function in getdist

To help you get started, we’ve selected a few getdist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cmbant / getdist / getdist / gui / mainwindow.py View on Github external
def errorReport(self, e, caption="Error", msg="", capture=False):
        if isinstance(e, SettingError):
            QMessageBox.critical(self, 'Setting error', str(e))
        elif isinstance(e, ParamError):
            QMessageBox.critical(self, 'Param error', str(e))
        elif isinstance(e, IOError):
            QMessageBox.critical(self, 'File error', str(e))
        elif isinstance(e, (GuiSelectionError, plots.GetDistPlotError)):
            QMessageBox.critical(self, caption, str(e))
        else:
            if not msg:
                import traceback

                msg = "\n".join(traceback.format_tb(sys.exc_info()[2])[-5:])
            QMessageBox.critical(self, caption, type(e).__name__ + ': ' + str(e) + "\n\n" + msg)
            del msg

            if not isinstance(e, GuiSelectionError) and not capture:
                raise
github cmbant / getdist / getdist / gui / mainwindow.py View on Github external
exec(script_exec, globaldic, localdic)

            for v in six.itervalues(localdic):
                if isinstance(v, plots.GetDistPlotter):
                    self.updateScriptPreview(v)
                    break

            self.exportAct.setEnabled(True)

        except SyntaxError as e:
            QMessageBox.critical(self, "Plot script", type(e).__name__ + ': %s\n %s' % (e, e.text))
        except Exception as e:
            self.errorReport(e, caption="Plot script")
        finally:
            QApplication.restoreOverrideCursor()
            plots.default_settings = oldset
            plots.set_active_style(old_style)
            self._set_rc(oldrc)
            self.showMessage()
github williamjameshandley / fgivenx / planck_style / planckStyle.py View on Github external
shortlabel[key] = value.replace(planck + ' ', '')

NoLowLhighLtau = r'\textit{Planck}$-$lowL+highL+$\tau$prior'
NoLowLhighL = r'\textit{Planck}$-$lowL+highL'
WPhighLlensing = r'\textit{Planck}+lensing+WP+highL'
WP = r'\textit{Planck}+WP'
WPhighL = r'\textit{Planck}+WP+highL'
NoLowL = r'\textit{Planck}$-$lowL'
lensonly = 'lensing'
HST = r'$H_0$'
BAO = 'BAO'


LCDM = r'$\Lambda$CDM'

s = copy.copy(plots.defaultSettings)
s.legend_frame = False
s.figure_legend_frame = False
s.prob_label = r'$P/P_{\rm max}$'
s.norm_prob_label = 'Probability density'
s.prob_y_ticks = True
s.param_names_for_labels = os.path.join(batchjob.getCodeRootPath(), 'clik_units.paramnames')
s.alpha_filled_add = 0.85
s.solid_contour_palefactor = 0.6

s.solid_colors = [('#8CD3F5', '#006FED'), ('#F7BAA6', '#E03424'), ('#D1D1D1', '#A1A1A1'), 'g', 'cadetblue', 'indianred']
s.axis_marker_lw = 0.6
s.lw_contour = 1

s.param_names_for_labels = os.path.normpath(os.path.join(os.path.dirname(__file__), '..' , 'clik_latex.paramnames'))

use_plot_data = getdist.use_plot_data