How to combine many plots with different colors

  • Thread starter Thread starter ggeo1
  • Start date Start date
  • Tags Tags
    Plots
Click For Summary

Discussion Overview

The discussion revolves around the challenge of combining multiple plots with different colors into a single plot using Mathematica. Participants explore various methods and commands related to plot styling and combination.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about how to combine multiple plots with different colors, noting an issue with the show command not recognizing the PlotStyle command.
  • Another participant references Mathematica's documentation, suggesting that multiple functions should be colored differently by default when plotted together.
  • A participant shares their attempt to use PlotStyle with multiple graphs but reports that it does not yield any results, indicating confusion about combining the plots.
  • Another participant clarifies that the Show command only combines Graphics objects and does not alter their properties, recommending that original graphs be created with the desired colors before combining them.
  • One participant confirms that using PlotStyle in each individual plot allows the Show command to display all three plots with their respective colors.

Areas of Agreement / Disagreement

Participants express differing views on the functionality of the Show command and its interaction with PlotStyle. There is no consensus on the best approach to combine plots, as some participants suggest different methods and experiences.

Contextual Notes

Some participants mention specific commands and their outcomes, but there are unresolved issues regarding the effectiveness of these commands in achieving the desired plot combination.

Who May Find This Useful

Users of Mathematica interested in plotting techniques, particularly those looking to combine multiple plots with distinct color schemes.

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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K