+ 1
How to create curve plot with code output values(numerical error vs no. Of steps)?
I have been trying to create code for FEA calculation, in which I get error value at each step. I want to create curve plot of same in Python. Can someone help me to overcome this. Thanks in advance.
5 Antworten
+ 2
For plotting and graphs, you can use the matplotlib library.
https://matplotlib.org/users/pyplot_tutorial.html
To understand your specific issue with the error message, post your code for review.
+ 2
I fixed the graph for you. The trick is to store the error values in a list, then pass it to the plot. In this case the values are indexed automatically from 0,1, ... which will be the X coord.
Actually there are many other ways you can pass the data to a plot, including numpy array or pandas dataframe. but this was the simplest.
https://code.sololearn.com/cX0KigrjZV6N/#py
+ 1
https://code.sololearn.com/cwYboA2H3j9I/?ref=app
+ 1
Tibor Santa , please have look at code.
I want to create surve for x,y which is output error from code.
+ 1
Hm okay I will have to test it on a computer because it won't run on Sololearn due to the imports. I will try to get back to you later