In a recent work [Shao $et$ $al$ 2009 Phys. Rev. Lett. textbf{108} 018701], a nonconsensus opinion (NCO) model was proposed, where two opinions can stably coexist by forming clusters of agents holding the same opinion. The NCO model on lattices and several complex networks displays a phase transition behavior, which is characterized by a large spanning cluster of nodes holding the same opinion appears when the initial fraction of nodes holding this opinion is above a certain critical value. In the NCO model, each agent will convert to its opposite opinion if there are more than half of agents holding the opposite opinion in its neighborhood. In this paper, we generalize the NCO model by assuming that each agent will change its opinion if the fraction of agents holding the opposite opinion in its neighborhood exceeds a threshold $T$ ($Tgeq 0.5$). We call this generalized model as the NCOT model. We apply the NCOT model on different network structures and study the formation of opinion clusters. We find that the NCOT model on lattices displays a continuous phase transition. For random graphs and scale-free networks, the NCOT model shows a discontinuous phase transition when the threshold is small and the average degree of the network is large, while in other cases the NCOT model displays a continuous phase transition.