Conversion LinePlot - ScatterPlot

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Conversion LinePlot - ScatterPlot

Barth
Dear all,

I am developping a data analysis software, which relies heavily on chaco plots. We can have in one figure quite a lot of plots, and for the visibility, it would be very nice if we could specify afterwards ( with the figure already drawn), the linewidth and color of the plots, as well as the presence or not of markers in the plot. 

Is it possible therefore to convert a lineplot in a scatterplot without having to delete it and rewrite it ? Alternatively, can i build a scatterplot with a line between the points and no markers ? 

Bests,

Pierre

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Conversion LinePlot - ScatterPlot

Robert Kern
On Wed, Jul 11, 2012 at 12:38 PM, Pierre Barthelemy <[hidden email]> wrote:

> Dear all,
>
> I am developping a data analysis software, which relies heavily on chaco
> plots. We can have in one figure quite a lot of plots, and for the
> visibility, it would be very nice if we could specify afterwards ( with the
> figure already drawn), the linewidth and color of the plots, as well as the
> presence or not of markers in the plot.
>
> Is it possible therefore to convert a lineplot in a scatterplot without
> having to delete it and rewrite it ? Alternatively, can i build a
> scatterplot with a line between the points and no markers ?

The easiest thing to do is to just do both the ScatterPlot and the
LinePlot with the same data. You can toggle each's visibility using
the .visible trait.

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

How can I add values dynamically to the CheckListEditor?

Robert Unguran
Hallo,

I have the following View and I would like to append new values to the
system variable when the submit button is fired. How can I do that?

class MCLidarSysView( HasTraits ):

     application = MCLidarAPI
     ip_address = Str
     system = List( editor = CheckListEditor(
                            values = [ 'None' ],
                             ) )
     submit = Button
     traits_ui_view = View(
                           Group(
                                 VGroup(
                                         HGroup(
                                                 Item( 'ip_address' ,
style = 'simple' , width = 100 ),
                                                 Item( 'system' , style
= 'simple' , width = 100 ),
                                                 Item( 'submit', style =
'simple' , show_label = False ),
                                                 )
                                         ),
                                 label = "Add system"
                                  ),
                         id = "forwind.sysinfo",
                         resizable = True
                         )

     def __init__( self, application, **traits ):
         HasTraits.__init__( self, **traits )
         self.application = application

     def _submit_fired( self ):
         self.system.append( "test" )

All the best
Robert
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can I add values dynamically to the CheckListEditor?

Robert Kern
On Wed, Jul 11, 2012 at 1:19 PM, Robert Unguran <[hidden email]> wrote:
> Hallo,
>
> I have the following View and I would like to append new values to the
> system variable when the submit button is fired. How can I do that?

Put the values in a separate List trait. Then use
CheckListEditor(name='that_other_trait') instead of setting
values=[...] explicitly.


> class MCLidarSysView( HasTraits ):
>
>      application = MCLidarAPI
>      ip_address = Str

       system_values = List(['None'])
       system = List(editor=CheckListEditor(name='system_values'))


Here is an example:

https://github.com/enthought/traitsui/blob/master/integrationtests/ui/check_list_editor_test2.py


By the way, although the example does specify the editor with the List
trait as you do, I really don't recommend this. Specifying the editor
in the Item() helps keep the model less tied to the UI specification.

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can I add values dynamically to the CheckListEditor?

Robert Unguran
Hi,

How can I format the string in a drop down List, For example in the
folder I have the following file: UPS_1500_EPS.dat, when I'm using the
code bellow I'm receiving Ups 1500 eps. How can I keep the upper-case? I
would like to have UPS 1500 EPS

     Ldata = [];
     if os.path.exists( "dir/systemdesc" ):
        for data in os.listdir( "dir/systemdesc" ):
             Ldata.append( ( data.partition( '.' )[0] ).replace( "_", "
" ) )

    self.values = Ldata



On 07/11/2012 02:31 PM, Robert Kern wrote:

> On Wed, Jul 11, 2012 at 1:19 PM, Robert Unguran <[hidden email]> wrote:
>> Hallo,
>>
>> I have the following View and I would like to append new values to the
>> system variable when the submit button is fired. How can I do that?
> Put the values in a separate List trait. Then use
> CheckListEditor(name='that_other_trait') instead of setting
> values=[...] explicitly.
>
>
>> class MCLidarSysView( HasTraits ):
>>
>>       application = MCLidarAPI
>>       ip_address = Str
>         system_values = List(['None'])
>         system = List(editor=CheckListEditor(name='system_values'))
>
>
> Here is an example:
>
> https://github.com/enthought/traitsui/blob/master/integrationtests/ui/check_list_editor_test2.py
>
>
> By the way, although the example does specify the editor with the List
> trait as you do, I really don't recommend this. Specifying the editor
> in the Item() helps keep the model less tied to the UI specification.
>


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can I add values dynamically to the CheckListEditor?

Robert Kern
On Wed, Jul 11, 2012 at 2:49 PM, Robert Unguran <[hidden email]> wrote:
> Hi,
>
> How can I format the string in a drop down List, For example in the
> folder I have the following file: UPS_1500_EPS.dat, when I'm using the
> code bellow I'm receiving Ups 1500 eps. How can I keep the upper-case? I
> would like to have UPS 1500 EPS

CheckListEditor(..., format_func=lambda x:x)

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev