Group Abstract Group Abstract

Message Boards Message Boards

0
|
5K Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

VertexColors not working with ListPlot3D

POSTED BY: Gary Lawson
4 Replies

Sander,

I followed your method exactly and the colors were properly rendered! Thank you very much for the help! And tally was a great addition, I was not aware of this function before and proves helpful as well.

POSTED BY: Gary Lawson

I'm not sure where your example goes wrong here is the correct way:

SetDirectory[NotebookDirectory[]];
data=Import["data.csv"];
colors=Import["color.csv"];
colors=Map[ToExpression,colors,{2}];
colors//Flatten//Tally
Dimensions/@{colors,data}

Note that I Map ToExpression over level 2, rather than level 1 as you did.

ListPlot3D[data, VertexColors -> {colors}]

VertexColors needs an extra {} for some reason I'm not sure of, probably if you have multiple plots, to distinguish each vertexcolors for each plot...

POSTED BY: Sander Huisman

Sander, thanks for your reply:

Yes I am able to run examples, such as the one I hyperlinked. Again, I cannot make the examples work with my data.

I'm using a 2D list of data, as I described terribly.

For the error, I lazily retyped the message and did not capitalize the color in the error; in the data files, the colors are capitalized (see colors.csv). Also, with the ToExpression command, I'm able to verify that the colors are imported correctly.

With a random array of colors, I receive the same error.

I've attached two files, examples of what I'm using; you can re-create the plot I previously screen captured with data.csv.

Attachments:
POSTED BY: Gary Lawson
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