Closed ivan2033 closed 4 months ago
Hi,
Thanks for taking the time to submit this Issue.
I am doing the following call: curvewidget.manager.register_all_curve_tools()
In PlotPy, curve widgets and image widgets have been merged in a unique class handling plots (PlotWidget
). This class may be specialized to handle curves or images by passing the type
argument:
# Using the builder:
from plotpy.builder import make
plot_widget = make.widget(wintitle="Title", type="curve")
# Using the class, if you need to customize it:
from plotpy.plot import PlotWidget, PlotOptions
plot_widget = PlotWidget(options=PlotOptions(title="Example", type="image"))
So basically, you shouldn't have to call directly register_all_curve_tools
because it is called automatically by PlotWidget
when "curve" has been chosen as a type of plot.
Does it help?
Thank you for answering so fast.
I have an UI made in QtDesigner for creating the plot (it should not mather, I just have changed the automa
tic code for adding the new parameters). If I have understand you well now I do the following when creating the plot:
self.curvewidgetAnalog = PlotWidget(parent=self.splitter, options=PlotOptions(title="Analog", type="curve"))
I can see the title (so the changes are applied), but the tools are still not created in the toolbar if I do not call the function I mentioned before. The ones that are shown are some specific created by myself.
Ok, maybe you are customizing the widget's toolbar after creating it.
In that case, you may do the folllowing (add the auto_tools=False
option, then called later register_tools
):
self.curvewidgetAnalog = PlotWidget(parent=self.splitter, options=PlotOptions(title="Analog", type="curve"), auto_tools=False)
# [...] your code [...]
self.curvewidgetAnalog.register_tools()
Yes! That solves the problem, now it just appears once.
Thank you very much for your help and congratulations for your work!
Glad that it solved your issue. All the best!
Hi,
I was using guiqwt and now I am moving to plotpy. I have an issue related to the curvewidget menu because it duplicates the right botton menu. It did not happen to me before with guiqwt.
I am doing the following call: curvewidget.manager.register_all_curve_tools()
Is there a way to "clean" the menu before adding the curves? Why does it happen now?
Kind regards, Iván