diff --git a/axis.cpp b/axis.cpp index c72b6f6..c646098 100644 --- a/axis.cpp +++ b/axis.cpp @@ -327,7 +327,7 @@ static void compile(const std::string& path, const std::string& src, bool static const std::string src0 = "\\IfFileExists{standalone.cls}{}{\\errmessage{The \"standalone\" package i" "s required.}}" + endl + - "\\documentclass"/*[varwidth]*/"{standalone}" + endl + + "\\documentclass{standalone}" + endl + "\\usepackage{xstring}" + endl + "\\makeatletter" + endl + "\\@ifclasslater{standalone}{2018/03/26}{}{\\usepackage{luatex85}}" + endl + @@ -511,12 +511,12 @@ void pgfplotter::Axis::squeeze() ySqueeze = true; } -void pgfplotter::Axis::squeeze_x() +void pgfplotter::Axis::squeezeX() { xSqueeze = true; } -void pgfplotter::Axis::squeeze_y() +void pgfplotter::Axis::squeezeY() { ySqueeze = true; } @@ -686,7 +686,7 @@ void pgfplotter::Axis::setView(double az, double el) _viewAngles = {az, el}; } -void pgfplotter::Axis::opacity(double n) +void pgfplotter::Axis::setSurfOpacity(double n) { _opacity = n; } @@ -696,8 +696,8 @@ void pgfplotter::Axis::noSep() _noSep = true; } -void pgfplotter::Axis::xTicks(const std::vector& locations, const std::vector< - std::string>& labels, bool rotate) +void pgfplotter::Axis::setXTicks(const std::vector& locations, const + std::vector& labels, bool rotate) { _xTicks = locations; _xTickLabels = labels; @@ -867,7 +867,6 @@ std::string pgfplotter::Axis::plot_src(const std::string& path, int subplot) con const double tempYMin = yMinSet ? yMin : yMinData; const double tempYMax = yMaxSet ? yMax : yMaxData; - //const double yRange = tempYMax - tempYMin; if(yMinSet || ySqueeze) { src += ", ymin = " + ToString(tempYMin); @@ -876,11 +875,6 @@ std::string pgfplotter::Axis::plot_src(const std::string& path, int subplot) con { src += ", ymax = " + ToString(tempYMax); } - /*if((yMinSet && yMaxSet) || ySqueeze) // Disables Lua backend if mesh plot - { - src += ", restrict y to domain = " + ToString(tempYMin - 10.0*yRange) + - ":" + ToString(tempYMax + 10.0*yRange); - }*/ // Z/meta max/min don't seem to affect contour placement in contour plots. if(zMinSet) @@ -899,11 +893,6 @@ std::string pgfplotter::Axis::plot_src(const std::string& path, int subplot) con } src += ", point meta max = " + ToString(zMax); } - /*if(zMinSet && zMaxSet) - { - src += ", restrict z to domain = " + ToString(zMin) + ":" + ToString( - zMax);//TEMP - }*/ if(!_xLabel.empty()) { @@ -1206,15 +1195,12 @@ std::string pgfplotter::Axis::plot_src(const std::string& path, int subplot) con } } - if(legendPos)// && names.size() == data.size()) + if(legendPos) { src += "\\legend{"; for(const auto& n : names) { -// if(!n.empty()) - { - src += n + ", "; - } + src += n + ", "; } src += "}" + endl; } diff --git a/pgfplotter b/pgfplotter index e381f2a..aa5aa69 100644 --- a/pgfplotter +++ b/pgfplotter @@ -114,9 +114,9 @@ namespace pgfplotter std::vector lineWidths; std::vector opacities; - std::array _viewAngles = {0.0, 90.0}; + std::array _viewAngles = {0., 90.}; - double _opacity = 1.0; // Should be per-surface (like `surfaceX`, etc.). + double _opacity = 1.; // Should be per-surface (like `surfaceX`, etc.). unsigned int legendPos = 0; @@ -140,8 +140,8 @@ namespace pgfplotter bool axisEqual = false; bool axisEqualImage = false; - double relWidth = 1.0; - double relHeight = 1.0; + double relWidth = 1.; + double relHeight = 1.; int xPrecision = -1; int yPrecision = -1; @@ -157,11 +157,11 @@ namespace pgfplotter bool _showColorbar = false; - double xSpacing = 0.0; - double ySpacing = 0.0; - double zSpacing = 0.0; + double xSpacing = 0.; + double ySpacing = 0.; + double zSpacing = 0.; - double xOffset = 0.0; + double xOffset = 0.; bool _noSep = false; @@ -211,8 +211,8 @@ namespace pgfplotter void legend(unsigned int location = Northeast); void squeeze(); - void squeeze_x(); - void squeeze_y(); + void squeezeX(); + void squeezeY(); void setXMin(double x); void setXMax(double x); void setYMin(double y); @@ -242,9 +242,9 @@ namespace pgfplotter void scale_z_spacing(double n); void x_offset(double n); void setView(double az, double el); - void opacity(double n); + void setSurfOpacity(double n); void noSep(); - void xTicks(const std::vector& locations, const std::vector< + void setXTicks(const std::vector& locations, const std::vector< std::string>& labels = {}, bool rotate = false); void bgBands(const std::vector& transitions); void bidirColormap();