I'm looking for a toolbar for matplotlib figure that contains more options than the basic one, which is automatically set in pyqt environment.
I already know how to add my own button, but I'm looking for a more advanced Toolbar already coded, that I can used directly.
In Matlab, for instance, it is possible to add points in the panel, or a text directly on the figure from the figure itself.
Outside of the one you're using, I don't think so. Try bokeh. Depending on your environment, ipywidgets may work too.
Hope that helps!
Related
I want to create a ToolBarToolBase object without adding it visibly to the toolbar. I've tried instantiating ToolBarToolBase, but I'm using wxPython version 2.8.12.1 (I can't upgrade, I'm doing this for work) so I don't think it's fully implemented. Is there any way to do this?
No. That widget is part of the toolbar. Just use a BitmapButton or a PlateButton. They both support images and would be more flexible to use anyway.
I'd like to know if a matplotlib chart be interactive, ie when you right click on a graph bar, a context menu opens, then you click one of the menu items and change the value of y value or you drag the top edge of the bar with mouse and it becomes taller etc,
In other words, can a matplotlib chart act like a GUI?
yep, though I should warn you: matplotlib isn't the best choice for interactive tasks. Depends on your tasks you may face performance or UX issues..
Take a look at the Chaco. It was designed for the creation of complex interactive plots.
Yes.
Matplotlib is based on Tkinter, so you can do all sorts GUI related things with it. For an example of how you can embed matplotlib in a Tkinter GUI see here:
http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html
Similarly for the functionality you are describing, you require plots that know when they've been clicked on (or mouse-overed) and that you can add callback events to. For that, the first place to look would be picker events:
http://matplotlib.org/examples/event_handling/pick_event_demo.html
As an alternative to some of the other ideas I would propose the Ipython notebook. For me it is the easiest way to do some of the things your asking about without having to get into Tkinter etc.
From Ipython 2.* onward there are interactive widgets allowing you to interact with the kernel from a GUI. I am not an expert in any sense so it is probably best explain by Fernando Perez himself.
Here is an example of interaction when solving the Lorenz differential equation demonstrating a chaotic system. This is accessible in the example of the ipython directory.
I am drawing a graph in python using Matplotlib library.
I want to remove the whole toolbar from the graph.
which look like this.
i have been trying alot but not able to figure out the way to do it.
kindly direct me to the File/code and suggest me the modifications to be carried out.
You can disable the tool bar via rcParams. Either add (or uncomment) the line
toolbar: None
in your matplotlibrc file or dynamically,
rcParams['toolbar'] = 'None'
I want to visualize some measurement values in realtime. I think - although not finally sure - I can do this with PyChart. The surrounding application is based on PyQt.
Now I', wondering how I can put the chart drawn using PyChart into some qt widget, may be a QGraphicWidget?
Could someone give me a bit advise?
Cheers,
Wolfgang
I have learned to do this by following the instructions of Eli Benderski.
It is answered here on this site in this thread
Demo Code is here
This uses matplotlib instead of PyChart. Usage of matplotlib is well documented here.
Matplotlib allows you to interact with the plot canvas as well as importing a Navigation Tool Bar.
Hope this is helpful.
Does anyone know if it's possible to add a label to a single tool in a wx.ToolBar? I've found a global setting but no option to set it for a single tool.
I have a feeling that's a limitation of the native widget. It's an all or nothing affair. You could make the label a part of the image on the tool item though. Or you might be able to do it with FlatMenu which has a Toolbar widget equivalent that's written in pure Python, so you can hack it. See the wxPython demo for an example of its API.