Go to the documentation of this file.
23 #ifndef COM_DAFER45_TBTK_VISUALIZATION_MAT_PLOT_LIB_PLOTTER
24 #define COM_DAFER45_TBTK_VISUALIZATION_MAT_PLOT_LIB_PLOTTER
39 #include "TBTK/Visualization/MatPlotLib/matplotlibcpp.h"
49 namespace Visualization{
206 void setSize(
unsigned int width,
unsigned int height);
226 void setBounds(
double minX,
double maxX,
double minY,
double maxY);
262 std::pair<
unsigned int, std::vector<double>>
271 void setTitle(
const std::string &title,
bool overwrite =
true);
278 void setLabelX(
const std::string &labelX,
bool overwrite =
true);
285 void setLabelY(
const std::string &labelY,
bool overwrite =
true);
292 void setLabelZ(
const std::string &labelZ,
bool overwrite =
true);
322 const Index &pattern,
371 const Index &pattern,
403 const Index &pattern,
438 const Index &pattern,
471 const Index &pattern,
562 void setRotation(
int elevation,
int azimuthal,
bool overwrite =
true);
582 void save(
const std::string &filename)
const;
590 const std::initializer_list<
591 std::pair<std::string, std::string>
598 const std::initializer_list<double> &data,
601 plot(std::vector<double>(data), argument);
605 const std::initializer_list<double> &x,
609 plot(std::vector<double>(x), y, argument);
614 const std::initializer_list<double> &y,
617 plot(x, std::vector<double>(y), argument);
621 const std::initializer_list<double> &x,
622 const std::initializer_list<double> &y,
626 std::vector<double>(x),
627 std::vector<double>(y),
634 enum class CurrentPlotType{None, Plot1D, PlotSurface, Contourf};
637 CurrentPlotType currentPlotType;
641 enum class PlotMethod3D{PlotSurface, Contourf};
644 PlotMethod3D plotMethod3D;
656 std::vector<std::pair<unsigned int, std::vector<double>>> axes;
659 unsigned int numLines;
662 unsigned int numContours;
666 const std::vector<double> &y,
672 const std::vector<double> &x,
673 const std::vector<double> &y,
679 const std::vector<std::vector<double>> &z,
685 const std::vector<std::vector<double>> &x,
686 const std::vector<std::vector<double>> &y,
687 const std::vector<std::vector<double>> &z,
700 const std::initializer_list<
701 std::pair<
unsigned int, std::pair<double, double>>
702 > &axisReplacement = {}
726 std::string doubleToHex(
double value)
const;
730 currentPlotType = CurrentPlotType::None;
731 plotMethod3D = PlotMethod3D::Contourf;
743 "Plotter::setBoundsX()",
744 "minX has to be smaller than maxX",
758 "Plotter::setBoundsY()",
759 "minY has to be smaller than maxY",
792 std::pair<
unsigned int, std::vector<double>>
799 plotParameters.
setTitle(title, overwrite);
800 plotSurfaceParameters.
setTitle(title, overwrite);
801 contourfParameters.
setTitle(title, overwrite);
802 matplotlibcpp::title(title);
806 plotParameters.
setLabelX(labelX, overwrite);
807 plotSurfaceParameters.
setLabelX(labelX, overwrite);
808 contourfParameters.
setLabelX(labelX, overwrite);
809 matplotlibcpp::xlabel(labelX);
813 plotParameters.
setLabelY(labelY, overwrite);
814 plotSurfaceParameters.
setLabelY(labelY, overwrite);
815 contourfParameters.
setLabelY(labelY, overwrite);
816 matplotlibcpp::ylabel(labelY);
820 plotSurfaceParameters.
setLabelZ(labelZ, overwrite);
824 if(plotMethod3D.compare(
"plot_surface") == 0){
825 this->plotMethod3D = PlotMethod3D::PlotSurface;
827 else if(plotMethod3D.compare(
"contourf") == 0){
828 this->plotMethod3D = PlotMethod3D::Contourf;
832 "Plotter::setPlotMethod3D()",
833 "Unknown plot method.",
834 "Must be 'plot_surface' or 'contourf'."
840 plotSurfaceParameters.
setRotation(elevation, azimuthal, overwrite);
841 switch(currentPlotType){
842 case CurrentPlotType::PlotSurface:
843 plotSurfaceParameters.
flush();
851 this->numContours = numContours;
859 plotParameters.
clear();
860 plotSurfaceParameters.
clear();
861 contourfParameters.
clear();
865 matplotlibcpp::clf();
869 matplotlibcpp::show();
873 matplotlibcpp::save(filename);
void setLabelY(const std::string &labelY, bool overwrite=true)
Definition: PlotSurfaceParameters.h:111
Array with additional information about its axes.
Definition: AnnotatedArray.h:41
Property container for density of states (DOS).
Definition: DOS.h:48
void setTitle(const std::string &title, bool overwrite=true)
Definition: ContourfParameters.h:83
Definition: PlotParameters.h:35
void setLabelZ(const std::string &labelZ, bool overwrite=true)
Definition: PlotSurfaceParameters.h:119
Argument to matplotlib.
Definition: Argument.h:59
void setLabelY(const std::string &labelY, bool overwrite=true)
Definition: PlotParameters.h:95
Property container for eigen values.
Property container for spin-polarized local density of states (spin-polarized LDOS).
Definition: SpinPolarizedLDOS.h:46
void setBoundsX(double minX, double maxX, bool overwrite=true)
Definition: PlotParameters.h:103
void setTitle(const std::string &title, bool overwrite=true)
Definition: PlotSurfaceParameters.h:95
void clear()
Definition: PlotParameters.h:138
void setLabelX(const std::string &labelX, bool overwrite=true)
Definition: PlotSurfaceParameters.h:103
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
void save(const std::string &filename) const
Definition: Plotter.h:872
void setBoundsY(double minY, double maxY)
Definition: Plotter.h:752
Property container for wave functions.
void clear()
Definition: PlotSurfaceParameters.h:179
void setBoundsX(double minX, double maxX, bool overwrite=true)
Definition: PlotSurfaceParameters.h:138
Array with additional information about its axes.
Parameter container for plotting using the matplotlib function contourf.
void setBoundsY(double minY, double maxY, bool overwrite=true)
Definition: PlotSurfaceParameters.h:149
void setBoundsY(double minY, double maxY, bool overwrite=true)
Definition: ContourfParameters.h:118
void setPlotMethod3D(const std::string &plotMethod3D)
Definition: Plotter.h:823
void setTitle(const std::string &title, bool overwrite=true)
Definition: Plotter.h:798
Definition: Vector3d.h:33
void setBoundsX(double minX, double maxX, bool overwrite=true)
Definition: ContourfParameters.h:107
void show() const
Definition: Plotter.h:868
void setLabelX(const std::string &labelX, bool overwrite=true)
Definition: PlotParameters.h:87
Definition: ContourfParameters.h:36
Property container for local density of states (LDOS).
Parameter container for plotting using the matplotlib function plot_surface.
void setSize(unsigned int width, unsigned int height)
Property container for spin-polarized local density of states (spin-polarized LDOS).
void plot(const Property::Density &density, const Argument &argument="")
Property container for density of states (DOS).
void setLabelX(const std::string &labelX, bool overwrite=true)
Definition: ContourfParameters.h:91
Property container for density.
Definition: Density.h:43
void setLabelY(const std::string &labelY, bool overwrite=true)
Definition: Plotter.h:812
void setLabelZ(const std::string &labelZ, bool overwrite=true)
Definition: Plotter.h:819
void setBoundsX(double minX, double maxX)
Definition: Plotter.h:737
Property container for magnetization.
void setRotation(int elevation, int azimuthal, bool overwrite=true)
Definition: Plotter.h:839
void setLabelX(const std::string &labelX, bool overwrite=true)
Definition: Plotter.h:805
void flush() const
Definition: PlotSurfaceParameters.h:160
void setTitle(const std::string &title, bool overwrite=true)
Definition: PlotParameters.h:82
void clear()
Definition: Plotter.h:858
void clear()
Definition: ContourfParameters.h:142
void setLabelY(const std::string &labelY, bool overwrite=true)
Definition: ContourfParameters.h:99
Property container for density.
Plotter()
Definition: Plotter.h:729
void setNumContours(unsigned int numContours)
Definition: Plotter.h:850
Plots data.
Definition: Plotter.h:197
void setBounds(double minX, double maxX, double minY, double maxY)
Definition: Plotter.h:767
Definition: PlotSurfaceParameters.h:36
void setBoundsY(double minY, double maxY, bool overwrite=true)
Definition: PlotParameters.h:114
void setRotation(int elevation, int azimuthal, bool overwrite=true)
Definition: PlotSurfaceParameters.h:127
Physical index.
Definition: Index.h:44
void setAxes(const std::vector< std::pair< unsigned int, std::vector< double >> > &axes)
Definition: Plotter.h:790
Parameter container for plotting using the matplotlib function plot.
Property container for eigen values.
Definition: EigenValues.h:46
Property container for wave function.
Definition: WaveFunctions.h:45
Property container for magnetization.
Definition: Magnetization.h:44