Skip to content

Commit

Permalink
Fixes mistakes in previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
pazmivaniye committed Jun 20, 2024
1 parent f505e09 commit c36509e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions axis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ static std::string convert_marker(char marker)
{
return "square*, mark options = {rotate = 45, scale = 0.6}";
}
if(marker == 'x')
{
return "x, mark options = {scale = 1.5}";
}
return std::string() + marker;
}

Expand Down
2 changes: 1 addition & 1 deletion pgfplotter
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace pgfplotter
{'S', 2./3., 0},
{'*', 2./3., 0},
{'D', 2./3., 0},
{'x', 2., 0},
{'x', 2./3., 0},
{'|', 2./3., 0},
MarkStyle::None()
}};
Expand Down
12 changes: 7 additions & 5 deletions test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
namespace pgf = pgfplotter;

static const std::string PlotName = "plot";
static constexpr double Pi = 3.14159265358979323846264338328;
static constexpr double TwoPi = 6.28318530717958647692528676656;

static std::string get_dir(const std::string& path)
Expand Down Expand Up @@ -121,17 +122,18 @@ int main(int, char** argv)
y[0][i] = std::cos(x[i]);
y[1][i] = 1. + std::sin(x[i]);
y[2][i] = std::max(0., std::min(1., 1. - std::tan(x[i])));
y[3][i] = 1. + std::sin(x[i]);
y[3][i] = 1. + std::sin(2.*x[i]);
y[4][i] = std::cos(std::sin(x[i]));
y[5][i] = 1. - std::cos(1 + x[i]);
y[5][i] = 1. - 2.*(x[i]/Pi - std::floor(x[i]/Pi));
}
q.draw(style, x, y[0], {}, {}, "$\\cos x$");
q.draw(style, x, y[1], {}, {}, "$1+\\sin x$");
q.draw(style, x, y[2], {}, {}, "$\\operatornamewithlimits{clamp}_{\\lef"
"t[0,\\,1\\right]}\\args{1-\\tan x}$");
q.draw(style, x, y[3], {}, {}, "$1+\\sin x$");
q.draw(style, x, y[3], {}, {}, "$1+\\sin\\args{2x}$");
q.draw(style, x, y[4], {}, {}, "$\\cos\\args{\\sin x}$");
q.draw(style, x, y[5], {}, {}, "$1-\\cos\\args{\\cos\\args{1+x}}$");
q.draw(style, x, y[5], {}, {}, "$1-2\\operatorname{frac}\\args{\\frac{x"
"}{\\pi}}$");
q.bgBands({0., 1., 2., 3., 4., 5., 6., x.back()});
q.squeezeX();
q.setYMin(-2.25);
Expand All @@ -140,7 +142,7 @@ int main(int, char** argv)
q.setTitle("Other Plot");
q.setXLabel("$x$");
q.setYLabel("$y$");
q.legend(pgf::Axis::Southeast);
q.legend(pgf::Axis::Southwest);
}
CATCH

Expand Down

0 comments on commit c36509e

Please sign in to comment.