How to combine many plots with different colors

  • Thread starter Thread starter ggeo1
  • Start date Start date
  • Tags Tags
    Plots
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 4K views
ggeo1
Messages
61
Reaction score
0
Hello,

as i say in title,my question is how to combine many plots with different colors in one plot.

The problem is that the show command doesn't recognize the PlotStyle command.

Thank you
 
Physics news on Phys.org
Hello

I tried this
Code:
 Plot[{graph1, graph2, graph3}, {t, 0, tmax}, 
 PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 1, 0], 
   RGBColor[0, 0, 1]}]

but it doesn't return any result.

My graph1 is
Code:
graph1 = Plot[Evaluate[FLI[t]], {t, 0, tmax}, PlotRange -> All, 
  PlotStyle -> RGBColor[0, 0.5, 1]]

but i don't know how to combine them.

Thanks
 
Show only combines Graphics objects, it doesn't change them.
Make your original graphs with the colors that you want, then combine with show.

If your plots are really slow to generate, then you can edit the underlying expression with a replacement rule. Eg
g1 = Plot[x^2, {x, -3, 3}]
produces the standard blue line.
g1//FullForm
shows the full expression, you see the blue is Hue[0.67, 0.6, 0.6], so you can make it red by
g1 /. Hue[0.67, 0.6, 0.6] :> RGBColor[1, 0, 0]
 
Ok thanks!

I used PlotStyle in every plot ,so the show command gave all three plots with their color.