Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The command like "subplot"doesn't work #310

Open
Loong99 opened this issue May 22, 2022 · 2 comments
Open

The command like "subplot"doesn't work #310

Loong99 opened this issue May 22, 2022 · 2 comments

Comments

@Loong99
Copy link

Loong99 commented May 22, 2022

plt::plot(t3, p3);
plt::subplot(2, 2, 1);
plt::title("p-t");
plt::xlabel("t/ms");
plt::ylabel("p/Mpa");

plt::plot(t3, p3);
plt::subplot(2, 2, 2);
plt::title("p-t");
plt::xlabel("t/ms");
plt::ylabel("p/Mpa");

plt::plot(t3, p3);
plt::subplot(2, 2, 3);
plt::title("p-t");
plt::xlabel("t/ms");
plt::ylabel("p/Mpa");

plt::plot(t3, p3);
plt::subplot(2, 2, 4);
plt::title("p-t");
plt::xlabel("t/ms");
plt::ylabel("p/Mpa");

It doesn't work well above, but work well below.
plt::figure(1);
plt::plot(t3, p3);
plt::title("p-t");
plt::xlabel("t/ms");
plt::ylabel("p/Mpa");
plt::figure(2);
plt::plot(l3, p3);
plt::title("p-l");
plt::xlabel("l/dm");
plt::ylabel("p/Mpa");
plt::figure(3);
plt::plot(t3, v3);
plt::title("v-t");
plt::xlabel("t/ms");
plt::ylabel("v/(m/s)");
plt::figure(4);
plt::plot(l3, v3);
plt::title("v-l");
plt::xlabel("l/dm");
plt::ylabel("v/(m/s)");
plt::show();

@ykachin
Copy link

ykachin commented May 28, 2022

you can change the subplot function code:

PyTuple_SetItem(args, 0, PyLong_FromLong(nrows));
PyTuple_SetItem(args, 1, PyLong_FromLong(ncols));
PyTuple_SetItem(args, 2, PyLong_FromLong(plot_number));

jonathanloganmoran added a commit to jonathanloganmoran/ND0013-Self-Driving-Car-Engineer that referenced this issue Jan 22, 2023
@eduardobehr
Copy link

Too bad this repository isn't updated since 2021.
@lava could you merge PR #333 to fix this issue?

srathi-monarch added a commit to srathi-monarch/matplotlib-cpp that referenced this issue Jul 31, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants