Example #1
0
func plotTcTp(tcEnvs, tpEnvs []*tempAll.Environment, fileLabelTcTp, xmax string) error {
	wd, _ := os.Getwd()
	grapherPath := wd + "/../plots/grapher.py"
	graphParams := map[string]string{plots.FILE_KEY: wd + "/" + fileLabelTcTp, plots.XLABEL_KEY: "$x_{eff}$", plots.YLABEL_KEY: "$T/t_0$", plots.YMIN_KEY: "0.0", "xmax": xmax}
	seriesParams := make([]map[string]string, 2)
	seriesParams[0] = map[string]string{"label": "$T_c/t_0$", "style": "b-"}
	seriesParams[1] = map[string]string{"label": "$T_p/t_0$", "style": "r--"}
	xsTc, xsTp, Tcs, Tps := []float64{}, []float64{}, []float64{}, []float64{}
	for _, tcEnv := range tcEnvs {
		xsTc = append(xsTc, tcEnv.X)
		Tcs = append(Tcs, 1.0/tcEnv.Beta)
	}
	for _, tpEnv := range tpEnvs {
		xsTp = append(xsTp, tpEnv.X)
		Tps = append(Tps, 1.0/tpEnv.Beta)
	}
	series := make([]plots.Series, 2)
	series[0] = plots.MakeSeries(xsTc, Tcs)
	series[1] = plots.MakeSeries(xsTp, Tps)
	err := plots.PlotMPL(series, graphParams, seriesParams, grapherPath)
	if err != nil {
		return err
	}
	return nil
}
Example #2
0
// Make a Fermi surface plot of env, which should be a
// pre-solved T=0, non-interacting Environment.
// precise=true makes a better-looking plot (delta->delta/10).
func FermiSurface(env *Environment, outPrefix, grapherPath string, precise bool) error {
	// blank data slots - relevant only for scatter plot
	data := []plots.Series{}
	seriesParams := []map[string]string{}
	// required data for FS plot
	params := make(map[string]string)
	params["plot_type"] = "Fermi_surface"
	params[plots.XLABEL_KEY] = "$k_x$"
	params[plots.YLABEL_KEY] = "$k_y$"
	params[plots.FILE_KEY] = outPrefix
	params["th"] = strconv.FormatFloat(env.Th(), 'f', 6, 64)
	params["thp"] = strconv.FormatFloat(env.Thp, 'f', 6, 64)
	params["t0"] = strconv.FormatFloat(env.T0, 'f', 6, 64)
	params["D1"] = strconv.FormatFloat(env.D1, 'f', 6, 64)
	params["Mu_h"] = strconv.FormatFloat(env.Mu_h, 'f', 6, 64)
	params["epsilon_min"] = strconv.FormatFloat(env.getEpsilonMin(), 'f', 6, 64)
	if precise {
		params["delta"] = strconv.FormatFloat(0.005, 'f', 6, 64)
	} else {
		params["delta"] = strconv.FormatFloat(0.05, 'f', 6, 64)
	}
	return plots.PlotMPL(data, params, seriesParams, grapherPath)
}