Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.7K Views
|
10 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Apply different colours to different ListPlots?

Posted 9 years ago
POSTED BY: Strange Ross
10 Replies

Which version are you using? I can't remember the default color to be black! Should be blue-ish...

data = {{5.44, 1.}, {13.44, 1.31351}, {21.44, 1.74846}, {29.44, 1.83433}, {37.44, 2.06847}, {53.44, 2.36553}, {77.44, 2.53351}}
d = 0.68
p = 8
y110 = 2
y210 = 3
data2 = {{d*p, y110}, {(1 + d)*p, y210}}
ListPlot[{data, data2}, PlotStyle -> {Red, Black}]

notice that I omitted the extra List[...] command

POSTED BY: Sander Huisman
POSTED BY: Strange Ross
POSTED BY: Robert Collyer

Then there is probably something 'different' (wrong?) with your data and data2:

data = Range[10]
data2 = 12 - Range[12]
ListPlot[{data, data2}, PlotStyle -> {Red, Blue}]

as you can see, this works perfectly fine. What are data and data2?

POSTED BY: Sander Huisman
POSTED BY: Strange Ross

PlotStyle is a ListPlot option. As I said before:

ListPlot[{data2,data},PlotStyle->{Red,Black}]

Alternatively, if you really want to use Show for some reason:

Show[ListPlot[data2,PlotStyle->Red], ListPlot[data,PlotStyle->Black], PlotRange -> All]
POSTED BY: Sander Huisman
POSTED BY: Strange Ross
POSTED BY: Sander Huisman

Hi Sander,

I think you missed my point. I want to color one dataset red, while the other remains black.

And I still do not know how to accomplish this.

Strange

POSTED BY: Strange Ross

Depending what data and data2 are, you can simply do:

ListPlot[{data2,data}]
POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard