Diagramm in Tkinter without Matplotlib - python

I need to create a line graph in Tkinter but I'm only allowed to use moduals built in to python-3.
So I can't use Matplotlib...
Is there any other way creating a line graph without using Matplotlib?
And if, how?
(The graph should also be editable to add/deleate and also transform the values)
I have tried to find any possible method but I couldn't find any...

Related

Can the plotly.io.write_html be used to also plot images?

Usually, we use the line to plot graphs and confusion matrices. However, the official documentation doesn't really specify which types of figures are supported.
Can I actually use it for image files?
(I tried using it but it doesn't run properly, I don't know whether it was because of it not supporting it)
Based on the documentation, it supports a fig meaning a plotly figure object.
Unless you create a plotly figure object containing your image, you won't be able to use plotly.io.write_html(fig, ...)

UI Adjustable Matplotlib Color Range

I am using Python's scientific plotting library matplotlib. I am trying to use matplotlib to show an image using imshow. I would like to be able to adjust the color range with in the figure with some type of UI. From what I can tell, there isn't a built-in way to do this in matplotlib, and I have found much on this issue. This is a fairly common use-case and easy to do in MATLAB. How does one do this in matplotlib?
I'm assuming you want to change the cmap attribute. You could use the built-in function input to read some new value from the command line (not really a GUI) or you could use the matplotlib.widgets package which includes e.g. a slider and buttons (see this link for examples).

Changing parameters while plotting in python

I have a code for plotting 3d scatterplot in python that updates after every 2 seconds (plot is dynamic). I wish to be able to adjust the values of some of the parameters on line (while plotting happens) based on which the plotting happens. Is it possible to give a textbox along with the plot from which we can take as input the required parameter value based on which this plot will then be subsequently modified?
Matplotlib does not have a textbox (or other text entry) widget. To use a textbox, you would need to embed a matplotlib graph within a separate GUI framework. To do this, decide on the GUI framework you want to use (qt, wx, gtk, or tkinter), and a textbox widget from the gui framework, and then add the plot from matplotlib. This isn't difficult and there are lots of available examples, generally best found for each specific framework you're interested in.
There might also be other pure matplotlib approaches that could work for you, such as using a matplotlib slider widget, or you could directly capture keyboard events, but without knowing exactly what you're going to for, it's hard to say.

Tool to create a python GUI for graph construction

I need to create a GUI for graph construction ("graph" as an abstract representation of a set of objects, not a visual representation of data). The interface will provide a choice of ~5 vertex types and of ~5 edge types. Each vertex will have two data fields: a text label and a file name, which need to be easily editable.
I'm familiar with igraph and have a lot of code written in it. I will use igraph to manipulate the graphs created with this GUI.
Since this will be my first GUI, I'm completely ignorant of what tools are available. Can you please suggest a free library, knowing that eventually the program will need to work on Windows?
EDIT
it seems from the answers I get that I wasn't clear enough. I'm not looking for a way to visualize a graph, but rather for a way to visually create one. By visually, I mean not needing to manually create text files or writing code.
Take a look at xdot.py.
From the homepage
xdot.py is an interactive viewer for graphs written in Graphviz's
dot language.
It uses internally the graphviz's xdot output format as an
intermediate format, and PyGTK and Cairo for rendering.
xdot.py can be used either as a standalone application from
command line, or as a library embedded in your python application.
I like networkx,
from networkx import draw, Graph
from pylab import show
g = Graph()
g.add_edges_from([(1,2),(1,3),(2,4),(2,5)])
draw(g)
show()
which gives,
The only quirk is the requirement for matplotlib to get builtin plotting to work.
If you use python, I think PyQt is a good selection.
What you have to install is listed below:
install Python from here
install PyQt4 from here
But it takes many lines to write GUI application,
it is sometimes better to generate an image to display with image viewer.

How to draw a 2D graph in Python - horizontal bars

I would like to make graph like this in Python:
I have made the program in C that will give me combinations I need (here N=2n+|m| iirc), so could I integrate that here somehow?
I made something in Mathematica, but that's a pain in the butt... Any help is appreciated.
I would customize CairoPlot for doing that (http://linil.wordpress.com/2008/09/16/cairoplot-11/ ) --
Cairoplot is a simple and small project to use the powerfull Cairo library to make Graph's.
It does have few, although beauutiful, graphic options, but it is entirely made in Python - it should be possible to subclass a graph class from there to generate plots that fit your need.
You could try using step() in matplotlib
http://matplotlib.sourceforge.net/examples/pylab_examples/step_demo.html

Categories

Resources