i want to display a graph in a canvas. The GUI was written in tkinter using python 2.7.
self.plotting(x, pa, y)
savefig("Omegakillerisawesome.png")
im=PhotoImage(file="Omegakillerisawesome.png")
self.canvasForGraph.create_image(500, 350, anchor=CENTER, image=im)
#show()
os.remove('Omegakillerisawesome.png')
The plotting function was implemented by me. accepting x,y values. so i'm hoping to show the graph in a canvas. so i'm saving the graph in the directory and reloading the image to the canvas. The problem is the .png file is not appearing in the canvas.
but if i uncomment the show() function the image comes up in the canvas as well as the usual window that graphs are displayed. i don't want that. i only want the graph to show up in the canvas.
please help. i'm a newbie.
[edit]
depth=[1,2,3,4,5,6]
temp=[9,8,7,6,5,4]
plot(depth,temp)
show()
this shows me a frame with my graph in it. but i want to do is display the graph inside a canvas widget using tkinter. but i dont want the usual frame that comes with the latter code. i just want the graph plotted inside the canvas no more.
that is what i'm trying to achieve from the first piece of code.
thanks.
Related
In my app I am easily able animate to move an image in kivy but not able to scale it in size using animate property. Can any one show an example how to do that. Please
I am trying to create place a gif onto my tkinter canvas, however it is just a still image when it is placed.
Does anyone know how I could maybe place it but it moves when the code runs?
I'm trying to include an interactive vpython window in a tkinter frame or canvas in order to visualise simple shapes (representing the mechanical assembly that will be sized). I can't find a frame or canvas method to integrate a vpython window properly. Do you know if it's even possible ? If it's not doable, which programming language should I pick to realize a GUI including 3D visualisation ?
Thanks for your help!
I've been making an application that uses matplotlib to make a line graph, but the issue I've been having is that when I try and hover over the graph, it is a static image that I can pan around, but I'm unable to get the values on my graph when I hover my mouse. I'm not looking to make a scatter graph, but a line graph that annotates over the values when I hover my mouse over it. I understand that matplotlib graphs can be made interactive with Dash/Plotly, but the issue is that they only work on webapps, and I am looking for a way to make my mpl graph look more like a plotly one on a Tk GUI app. Any way that this is possible?
I'm trying to create a list of plots one below the other, on the same axes.
I want to be able to scroll through the plots, and when resizing the view I want to display more plots rather than enlarging the existing plots.
I subclasses PlotWidget and tried to manipulate resizeEvent and sizePolicy and nothing worked.
Any idea?
Thanks
Update:
This is the initial view. When changing the window's height I get this.
What I'm trying to achieve is this.
Also, I would like to add a vertical scrollbar instead of vertical panning.
Update:
Apparently pyqtgraph isn't a good fit for what I'm trying to do. I ended up implementing with QGraphicsScene and QGraphicsView.