GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — matplotlib-cpp/examples/string_xaxis_named_plot.cpp at master · lava/matplotlib-cpp

Expand file tree

/

string_xaxis_named_plot.cpp

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
25 lines (21 loc) · 697 Bytes
/

string_xaxis_named_plot.cpp

Copy path

File metadata and controls

25 lines (21 loc) · 697 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "../matplotlibcpp.h"
#include <string>
#include <vector>
namespace plt = matplotlibcpp;
int main()
{
const std::vector<std::string> months = {
"Jan 2021", "Feb 2021", "Mar 2021", "Apr 2021", "May 2021"
};
const std::vector<double> speed_kmh = {58.4, 61.2, 63.9, 62.1, 65.0};
plt::figure_size(900, 500);
plt::named_plot("Vehicle speed (max)", months, speed_kmh, "o-");
plt::title("Monthly peak speed");
plt::xlabel("Month");
plt::ylabel("Speed (km/h)");
plt::legend();
plt::tight_layout();
// Use save() for CI/headless usage; replace with show() for interactive runs.
plt::save("./string_xaxis_named_plot.png");
return 0;
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.