[英]How can I customize my graph figures in matplotlib.figure.Figure such as changing marker size?
The following code is in my matplotlib graphing class that I embedded into tkinter, and it creates the desired figure (shape of graph is correct):以下代码在我嵌入到 tkinter 中的 class 的 matplotlib 图形中,它创建了所需的图形(图形形状正确):
df = pd.read_csv('data.csv')
fig = Figure(figsize=(12, 10), dpi=100)
fig.add_subplot(111).scatter(df['A'], df['B'])
canvas = FigureCanvasTkAgg(fig, master=self.parent)
canvas.draw()
canvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=1)
The problem I'm having is styling the graph.我遇到的问题是图形的样式。 How do I make the marker size significantly smaller?
如何使标记尺寸显着变小? How do I customize the library to make it styled the way I want?
如何自定义库以使其样式符合我的要求?
Use the s
parameter of scatter?使用scatter的
s
参数? See examples here 在此处查看示例
fig.add_subplot(111).scatter(df['A'], df['B'], s=SOME_NUM)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.