if you're writing your own API, I would recommend picking something very low level and established as a backend, otherwise limitations and thus hacky solutions will ruin it quickly. i'd say, there are several bottlenecks to consider before diving into any of options:
- do you need latex?
- how large of datasets are you planning to plot?
- for 3d, do you need raytraced volume rendering, or will meshes be enough?
based on those, i'd recommend the following.
- drop c/c++ -- it's gonna be too much effort for too little advantage. there are no well-established and properly maintained plotting packages in c/c++ (implot comes close, but is very limited and often slow).
- if you need to run the library in a browser (webapp), look into d3js for frontend (i.e. building the axes, putting ticks etc), and a flask-based python server for backend (to actually read the data and produce the heaviest plots). if you need latex, just use katex on the frontend.
- for heavy data vis, look into python dask and datashader libraries.
- for 3d, there is really no good solution, but vtk is close. volume rendering though would be tough, i would recommend looking into ospray or other stuff like that.
let me know if you need any more details on any of the mentioned things.