The problem of data-driven control is addressed here in the context of switched affine systems. This class of nonlinear systems is of particular importance when controlling many types of applications in electronic, biology, medicine, etc. Still in the view of practical applications, providing an accurate model for this class of systems can be a hard task, and it might be more relevant to work on data issued from some trajectories obtained from experiments and to deploy a new branch of tools to stabilize the systems that are compatible with the processed data. Following the recent concept of data-driven control design, this paper first presents a generic equivalence lemma that shows a matrix constraint based on data, instead of the system parameter. Then, following the concept of robust hybrid limit cycles for uncertain switched affine systems, robust model-based and then data-driven control laws are designed based on a Lyapunov approach. The proposed results are then illustrated and evaluated on an academic example.