Skip to content

Improve documentation for color_sequences with ( example ) #29559

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

Conversation

SHRISHTISHUKLA-0
Copy link

here this (PR) improves the documentation for color_sequences by
adding clear examples demonstrating how to define color cycles both manually and also for using the color_sequences registry
main point is - benefits of using color_sequences over manual definitions, such as reusability, consistency, and easier customization and clarifying the differences between color_sequences and manually defined color cycles to help to understand their distinct purposes.
I think first I have add this all information in wrong file may be this time its correct
and the current documentation lacked detailed examples and clear explanations regarding the color_sequences registry. this PR aims to address those gaps, making it easier to use

important Changes is:
added new content under the User Guide section related to color management.
Included two code examples: 1. manual color cycle Example and second one
2. using color_sequences registry Example=

Example 1: manually defining a color cycle

import matplotlib.pyplot as plt
from cycler import cycler
plt.rc('axes', prop_cycle=cycler('color', ['#FF5733', '#33FF57', '#3357FF']))
plt.plot([1, 2, 3], [4, 5, 6])
plt.plot([1, 2, 3], [6, 5, 4])
plt.show()

Example 2: Using color_sequences registry

from matplotlib import rcParams
rcParams['axes.prop_cycle'] = plt.cm.get_cmap('tab10').colors
plt.plot([1, 2, 3], [4, 5, 6])
plt.plot([1, 2, 3], [6, 5, 4])
plt.show()

improvements for documentation are -
clarity: user can now easily understand the differences between manual and registry-based methods and second is practical Value: the added examples allow to user apply these concepts immediately and color management.

and by the way thank you for the previous review I incorporated the feedbacks by
adding comprehensive examples and explaining the core concepts more clearly and also I came to know that ensuring the documentation fits logically within the User Guide:)

@rcomer
Copy link
Member

rcomer commented Feb 1, 2025

This PR adds one commit compared to #29554, and makes no difference to the text.
SHRISHTISHUKLA-0/matplotlib@shmatplotlib28750...SHRISHTISHUKLA-0:matplotlib:customize-color-sequence-doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants