Discussion:
Change color of a curve
Andrea Corna
2013-05-08 07:13:03 UTC
Permalink
Hello,
I'm writing a small script for data analysis and display with guiqwt.
I want to change the color of a curve, retrieved as CurveItem object from a
PlotManger with get_items().
I wasn't able to find how to do this operation in the documentation, can
you help me?

Thanks in advance

Andrea Corna
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Carlos Pascual
2013-05-08 10:37:12 UTC
Permalink
Hi,
for a cursor item, the following works for me:

+++++++++++++++++++++
from PyQt4 import Qt
(...)
c.setLinePen(Qt.QPen(Qt.QColor('red')))
+++++++++++++++++++++

I guess it would work for a curve as well.

Cheers,
Post by Andrea Corna
Hello,
I'm writing a small script for data analysis and display with guiqwt.
I want to change the color of a curve, retrieved as CurveItem object from a
PlotManger with get_items().
I wasn't able to find how to do this operation in the documentation, can
you help me?
Thanks in advance
Andrea Corna
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
Cells / Alba Synchrotron [http:/www.cells.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpascual-***@public.gmane.org
Phone: +34 93 592 4428
+----------------------------------------------------+
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Andrea Corna
2013-05-14 18:19:33 UTC
Permalink
It worked, thanks!
Just for future reference, i've used setPen(), insted of setLinePen()

Regards,

Andrea
Post by Carlos Pascual
Hi,
+++++++++++++++++++++
from PyQt4 import Qt
(...)
c.setLinePen(Qt.QPen(Qt.QColor('red')))
+++++++++++++++++++++
I guess it would work for a curve as well.
Cheers,
Post by Andrea Corna
Hello,
I'm writing a small script for data analysis and display with guiqwt.
I want to change the color of a curve, retrieved as CurveItem object
from a
Post by Andrea Corna
PlotManger with get_items().
I wasn't able to find how to do this operation in the documentation, can
you help me?
Thanks in advance
Andrea Corna
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
Cells / Alba Synchrotron [http:/www.cells.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
Phone: +34 93 592 4428
+----------------------------------------------------+
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Andrea Corna
2014-03-17 16:13:05 UTC
Permalink
Just for future reference, the setPen() method, should be followed by a
call to update_param, otherwise the curve's colour return to black when you
select it.
Here a snippet of my code:

curves =
self.get_plot().get_public_items(item_type=guiqwt.interfaces.ICurveItemType)
for curve in curves:
pen = PyQt4.QtGui.QPen(colour)
curve.setPen(pen)
curve.curveparam.update_param(curve)

Andrea
Post by Andrea Corna
It worked, thanks!
Just for future reference, i've used setPen(), insted of setLinePen()
Regards,
Andrea
Il giorno mercoledì 8 maggio 2013 12:37:12 UTC+2, Carlos Pascual ha
Post by Carlos Pascual
Hi,
+++++++++++++++++++++
from PyQt4 import Qt
(...)
c.setLinePen(Qt.QPen(Qt.QColor('red')))
+++++++++++++++++++++
I guess it would work for a curve as well.
Cheers,
Post by Andrea Corna
Hello,
I'm writing a small script for data analysis and display with guiqwt.
I want to change the color of a curve, retrieved as CurveItem object
from a
Post by Andrea Corna
PlotManger with get_items().
I wasn't able to find how to do this operation in the documentation,
can
Post by Andrea Corna
you help me?
Thanks in advance
Andrea Corna
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
Cells / Alba Synchrotron [http:/www.cells.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
Phone: +34 93 592 4428
+----------------------------------------------------+
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Darga Arouna
2013-05-08 10:57:15 UTC
Permalink
Dear all
I follow the topics with great pleasure. 
Now i would like to getting started! 
Please can someone give me some examples for data displaying and analysis. I want to
1) select data from file to display (y vs x) 
2) select a range  in the displayed data for fitting. Linear fit.
I don't know if guiwt can do this.
Any suggestions comments and example are welcome
Best regards
Arouna Darga

-------- Message d'origine --------
De : Carlos Pascual <cpascual-***@public.gmane.org>
Date : 08/05/2013 12:37 (GMT+01:00)
A : guidata_guiqwt-/***@public.gmane.org
Cc : Andrea Corna <yak.bizzarro-***@public.gmane.org>
Objet : Re: [guidata/guiqwt] Change color of a curve

Hi,
for a cursor item, the following works for me:

+++++++++++++++++++++
from PyQt4 import Qt
(...)
c.setLinePen(Qt.QPen(Qt.QColor('red')))
+++++++++++++++++++++

I guess it would work for a curve as well.

Cheers,
Post by Andrea Corna
Hello,
I'm writing a small script for data analysis and display with guiqwt.
I want to change the color of a curve, retrieved as CurveItem object from a
PlotManger with get_items().
I wasn't able to find how to do this operation in the documentation, can
you help me?
Thanks in advance
Andrea Corna
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
Cells / Alba Synchrotron  [http:/www.cells.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpascual-***@public.gmane.org
Phone: +34 93 592 4428
+----------------------------------------------------+
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Carlos Pascual
2013-05-08 13:11:27 UTC
Permalink
Post by Darga Arouna
Dear all
I follow the topics with great pleasure.
Now i would like to getting started!
Please can someone give me some examples for data displaying and analysis.
Just a note: If your question is new, please start a new thread (instead of
replying to an unrelated one)
Post by Darga Arouna
I want to
1) select data from file to display (y vs x)
IMHO this is not a guiqwt question.
You may be interested in looking at numpy.loadtxt
Post by Darga Arouna
2) select a range in the displayed data for fitting. Linear fit.
check the fit.py example in guiqwt/tests/
Post by Darga Arouna
I don't know if guiwt can do this.
Any suggestions comments and example are welcome
Best regards
Arouna Darga
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
Cells / Alba Synchrotron [http:/www.cells.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpascual-***@public.gmane.org
Phone: +34 93 592 4428
+----------------------------------------------------+
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...