Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试绘制一个实时图表,其中 x 轴从 0 到 -40,y 轴从 0 到 200000000。如何在 C 中自动缩放这个图表?
不确定我是否正确理解了您的问题。如果您要归档的内容是将样本放入 WxH 像素的区域,您可以缩放它们:
float d = max_y - min_y; float s = (sample - min_y) / d; int y = s * height;