Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow more than 2 colormaps again #493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Kully merged 5 commits into master from trisurf_plus_2_colormap
Jun 3, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Made facecoloring neater
  • Loading branch information
Kully committed Jun 3, 2016
commit dda0a9a09779b0844f67b88c9d6a44fea6f497d0
16 changes: 8 additions & 8 deletions plotly/tools.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1525,17 +1525,17 @@ def _map_face2color(face, colormap, vmin, vmax):
face_color = FigureFactory._convert_to_RGB_255(face_color)
face_color = FigureFactory._label_rgb(face_color)
else:
# find the normalized distance t of a triangle face between vmin
# and vmax where the distance is normalized between 0 and 1
t = (face - vmin) / float((vmax - vmin))
low_color_index = int(t / (1./(len(colormap) - 1)))

if t == 1:
face_color = colormap[low_color_index]
if face == vmax:
Copy link
Contributor

@theengineear theengineear Jun 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is even clearer than what I was suggesting. thanks :)

Kully reacted with thumbs up emoji
# pick last color in colormap
face_color = colormap[-1]
Copy link
Contributor

@theengineear theengineear Jun 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 🔔 🎆

face_color = FigureFactory._convert_to_RGB_255(face_color)
face_color = FigureFactory._label_rgb(face_color)

else:
# find the normalized distance t of a triangle face between
# vmin and vmax where the distance is between 0 and 1
t = (face - vmin) / float((vmax - vmin))
low_color_index = int(t / (1./(len(colormap) - 1)))

face_color = FigureFactory._find_intermediate_color(
colormap[low_color_index],
colormap[low_color_index + 1],
Expand Down

AltStyle によって変換されたページ (->オリジナル) /