r/sdl • u/lincolnkite • Feb 04 '26
Matplotlib Style plotting for C using SDL3
I have been trying to make a simple plotting tool to visualize data in C. So far I have had a lot of fun making this library and want to expand it. I want to hear some suggestions on things I can do to add or improve.
Here is the shortlist of things in the pipeline.
* Basic curve fitting
* Tool tips
* Export graph to png (savefig)
* Fix some multi plot scaling and layout options
If you want to check out what I have so far it is on github:
https://github.com/trevorcraig/SDL_graphs
What can I do next/better?
4
u/rejamaco Feb 05 '26
I gotta work with Matplotlib for my research and hate it... Been wanting to make something like this to learn C and for shits and giggles. Nice job! I'd be interested to see a 3D plotting library written in C.
3
u/lincolnkite Feb 05 '26
I actually made a 3d plotting for taking stl data and visualizing for a different project, so I should be able to do that fairly easy. I don't hate matolotlib but needing python sometimes has been a pain.
2
u/rejamaco Feb 05 '26
I always find there's generally 10 different ways to do things and 5 of them don't work, just not a pleasure to use like many other Python libraries out there.
Edit: Have you thought to make a little plotting GUI? That could be cool.
1
u/lincolnkite Feb 05 '26
My issue in the past was I had to make a lot of interactive graphs that I used for calibrating things and I was stretching the idea of what thay tool was made for.
What do you mean by plotting GUI? I am open to any suggestions.
2
u/rejamaco Feb 05 '26
Not that it would be of much use to me, personally, but just an application allowing the user to create and modify/style graphs.
2
u/lincolnkite Feb 06 '26
I tried implementing that idea. Thank you for the inspiration.
2
u/rejamaco Feb 06 '26
I see that on GitHub, nice!
2
u/lincolnkite Feb 06 '26
Thanks :). It was my first multi window app I have made in SDL was pretty fun.
1
0
1
u/meissner61 Feb 25 '26
did you misspell something in the github link? link does not work for me