-
Notifications
You must be signed in to change notification settings - Fork 46
Changing qwt5.TaurusPlot curves legend titles? #1165
Comments
Hi @hayg25 ,
|
Hi @cpascual, Thanks |
Ok, then what you want is explained here: I hope that helps |
Thx for your help. |
Oh, sorry, I understood that you wanted it in the UI. What I sent is the UI way to do it.
|
By the way... I recommend not to waste much time learning the API of |
thanks for the answers. Do you believe that |
Well... On the other hand, the new one also has some features not available in the old one, and it offers a lot more possibilities in terms of customization. It is actively developed and is the default in Taurus now. At this point, from the UI point of view the new one might not seem as being as good or polished as the old one, but in terms of programming API it is way better, and in terms of maintainability it is the only option. |
many thanks for the feedback |
dear @cpascual , Thanks again |
Hi According to the docs for setCurvesTitle it accepts 2 args: a If you want to use different
|
Hi @cpascual , I have tried that method which works for see that simple example : class GraphiqueTendance(TaurusWidget):
"""
Graphique affichant deux variables en fonction du temps.
"""
def __init__(self, parent=None):
# appel de l'initialisation de la classe parent
TaurusWidget.__init__(self, parent=parent)
## DEBUT ZONE MODIFIABLE
# initialisation de l'objet avec ses proprietes
tendance = TaurusTrend()
# creation du modele : on peut ajouter plusieurs variables
modelTendance = ['sys/tg_test/1/long64_scalar', 'sys/tg_test/1/long_scalar']
# definition des abcisses comme axe du temps
tendance.setXIsTime(True) # to show the x values as time
# création et application d'un cadre visuel sous forme de grille
layout = Qt.QGridLayout()
self.setLayout(layout)
# association objet-device
tendance.setModel(modelTendance)
tendance.setCurvesTitle('Curve A', ['sys/tg_test/1/long64_scalar'])
tendance.setCurvesTitle('Curve B', ['sys/tg_test/1/long_scalar'])
tendance.setAxisTitle(0, 'Y title')
tendance.setAxisTitle(2, 'X title')
layout.addWidget(tendance) which returns the error message :
|
The TaurusPlot creates a TaurusCurve for each model, but the TaurusTrend creates a TaurusTrendSet (which in turn contains one or more TaurusCurves) for each model (because TaurusTrend also accepts arrays as its model, and creates a curve for each element of the array). Have a look at PS: note that quite probably the next taurus release won't support |
Dear all,
I would need to modify the curves legend in my code.
Thanks for the help
The text was updated successfully, but these errors were encountered: