Skip to content

"pyplot.plot_date()" is not changing the line colors using "color_cycle" #2148

Closed

Description

@saullocastro

Please, check this question in Stackoverflow:
http://stackoverflow.com/q/17250392/832621
which motivated this bug report.

The OP identified that when trying to plot using plot_date() the colors are not changed accordingly to the color_cycle specified. Actually they are not changing at all.
With plot() it works perfectly.
I tried to change the colors from plot_date() using:
plt.rc('axes', **{'color_cycle':['r', 'g']})
plt.rcParams['axes.color_cycle']=['r','g']
and
setting the matplotlibrc file to the local folder with axes.color_cycle : r, g.

they all did not work.

thank you very much and congratulations for the great package which Matploblib already is!
Saullo Castro

Activity

  1. tacaswell commented on Jun 23, 2013

    @tacaswell
    Member

    This isn't a bug, but a design choice. There is a default argument in both plt.date_plot and axes.date_plot that sets the format to bo.

    See https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes.py#L4145 and https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/pyplot.py#L2997

  2. saullocastro commented on Jun 24, 2013

    @saullocastro
    Author

    Thank you all for the responses... It is ok that data_plot() sets the format to bo but why the user cannot change it?

  3. WeatherGod commented on Jun 24, 2013

    @WeatherGod
    Member

    Probably wasn't a conscious design choice. I move to switch it over to
    None, so that the color-cycling mechanism can happen.

  4. saullocastro commented on Jun 24, 2013

    @saullocastro
    Author

    Are you going to switch it to None for the next version? That would be great! In matplotlib 1.2.1 is there a way to switch it to None?

  5. tacaswell commented on Jun 24, 2013

    @tacaswell
    Member

    @saullocastro Call it as

    plot_data(..., fmt=None)
    
  6. saullocastro commented on Jun 24, 2013

    @saullocastro
    Author

    @tacaswell Thank you! For me it worked doing plot_date(..., fmt='')

  7. omkarkulkarni commented on Feb 2, 2017

    @omkarkulkarni

    fmt is for the shape, what can we use for size.
    I tried with m or ms or s but all throw error.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions