-1

我正在使用 Python,并且我有一些数据可以投影到边长总和为 1 的等边三角形内的点上。

我不确定是否有一种简单的方法可以从 Matplotlib 或类似的库中可视化这样的绘图,或者我是否只需要从头开始使用绘图包来实现它。任何指针都感激地收到。谢谢!

4

1 回答 1

0

If all you want to do is plot a few dots on a graph, you can infact use Matfplotlib's scatter plots for this: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.scatter.html

Using plt.xlim(*min*, *max*) and plt.ylim(*min*, *max*), you can set the limits of the graph manually to fit your values (might not be neccessary though).

You can draw lines on the graph for the triangle shape (if you need that): How to draw a line with matplotlib?

If you don't need a scale, you can even remove that to have a blank canvas: Matplotlib plots: removing axis, legends and white spaces

于 2021-07-02T13:09:24.323 回答