Comments (1)
Hello!! The issue you're facing stems from the fact that self.Live_ax.lines is a list of Line2D objects, and these objects do not have a remove() method. Instead, you can use the remove() function of the container, which is the axis itself (self.Live_ax in this case).
Actualiza el gráfico para mostrar la nueva imagen gráfica de la línea actual
def Update_Live_Graph(self, X_Data, Y_Data, X_est, Y_est):
self.Live_Canvas.restore_region(self.Live_background)
self.Live_ax.set_xlim(X_Data[0] - 300, X_Data[0] + 100)
# Plots gráfico teórico
if X_est is not None:
if self.Live_X:
self.Current_Lines_est = self.Live_ax.plot(X_est, Y_est, color='red', linestyle='dashed')[0]
self.Live_Figure.add_artist(self.Current_Lines_est)
self.Live_Figure.draw_artist(self.Current_Lines_est)
else:
X_est = np.append(X_est[0] + 300, X_est)
Y_est = np.append(Y_est, Y_est[-1])
self.Current_Lines_est = self.Live_ax.plot(X_est, Y_est, color='red', linestyle='dashed')[0]
self.Live_Figure.add_artist(self.Current_Lines_est)
self.Live_Figure.draw_artist(self.Current_Lines_est)
# Draw the True line
self.Current_Lines = self.Live_ax.plot(X_Data, Y_Data, color='blue')[0]
# Draw the marker to highlight the last point
self.Last_Point = self.Live_ax.plot(X_Data[0], Y_Data[0], color='black', marker='.', linewidth=4, markersize=10)[0]
self.Live_Figure.add_artist(self.Current_Lines)
self.Live_Figure.draw_artist(self.Current_Lines)
self.Live_Figure.add_artist(self.Last_Point)
self.Live_Figure.draw_artist(self.Last_Point)
# Refresh the canvas
self.Live_Canvas.blit(self.Live_ax.bbox)
# Remove the lines from the image
try:
self.Live_ax.lines.remove(self.Current_Lines_est)
self.Live_ax.lines.remove(self.Current_Lines)
except ValueError:
pass
self.Current_Lines_est.remove()
self.Current_Lines.remove()
self.Last_Point.remove()
from python.
Related Issues (20)
- Build Test Broken
- Learning Python HOT 1
- @Git~CDT Open Repo~Nomine'
- Adding Gaussian Error Linear Unit to neural network activation functions HOT 1
- Misformatted/linked wiki entry in python sorting
- Global variable should not using in class method HOT 3
- Broken Computer Vision README url
- Improve our test coverage HOT 2
- Adding Financial algorithms in Python HOT 4
- Haversine distance may be using the wrong phi1 and phi2 angle
- data_structures/trie/radix_tree.py wont really end up in 'case 1' for insert HOT 1
- TensorFlow in FINALLY compatible with Python 3.12
- Migrate to numpy 2.0 HOT 3
- Engineering HOT 5
- Failure when running pre-commit and try to fix errors.
- Import Issue in Gaussian naive bayes example HOT 4
- mimetypes can't get demo.js type HOT 5
- Implementation of the Knapsack Problem Solver HOT 1
- aa
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python.