Movatterモバイル変換


[0]ホーム

URL:


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

Inconsistent behavior of markevery between semilogx and semilogy plots #8356

Closed
@Naereen

Description

@Naereen

Bug report

  • Themarkevery option forplot,semilogx,semilogy, andloglog plotting methods has a weird difference of behavior betweenplot / semilogy andsemilogx / loglog, when usingmarkevery = (float, float).

Code for reproduction

importnumpyasnpimportmatplotlib.pyplotasplt# Generate some dataX=np.linspace(-10,10,1000)Y=np.sin(X)**2# Specify markersmarkers= ['o','v','^','<','>']defmarkevery(i):# I tried a *lot* of values here, none were working for the 4 plotsreturn (i/50.,0.1)plt.figure()# First plot in normal plotplt.subplot(221)foriinrange(10):plt.plot(X,Y+i/10.,marker=markers[i%len(markers)],markevery=markevery(i),label=str(i))plt.legend()plt.title("plt.plot(): markers are here!")# Then plot in semilogxplt.subplot(222)foriinrange(10):plt.semilogx(X,Y+i/10.,marker=markers[i%len(markers)],markevery=markevery(i),label=str(i))plt.legend()plt.title("plt.semilogx(): markers are NOT here!")# And then semilogyplt.subplot(223)foriinrange(10):plt.semilogy(X,Y+i/10.,marker=markers[i%len(markers)],markevery=markevery(i),label=str(i))plt.legend()plt.title("plt.semilogy(): markers are here!")# Finally plot in loglogplt.subplot(224)foriinrange(10):plt.loglog(X,Y+i/10.,marker=markers[i%len(markers)],markevery=markevery(i),label=str(i))plt.legend()plt.title("plt.loglog(): markers are NOT here!")plt.suptitle("Weird behavior of markevery between plt.plot, plt.semilogx, plt.semilogy, plt.loglog")plt.show()

Actual outcome
bug_markevery

Expected outcome

  • One would expect the markers to be located in asimilar fashion for each of the four plots method,plot,semilogx,semilogy, andloglog. The two plots on the left have markers correctly located (well spacen, with a different starting point for the different curves), and the two plots on the right do not show markers.
  • Note that I tried a lot of different values for themarkevery parameters (heremarkevery = (i / 50., 0.1) for the various curves, with changingi to change the starting point of the markers), and always encounter this inconsistency between left and right.

Matplotlib version

  • Matplotlib version 2.0.0 (2.0.0+3337.gc15694b), with Python 3.5, on Ubuntu 16.10
  • Python installed with apt, latest version of Matplotlib installed withpip --upgrade.

Maybe I don't understand thesemantic behind usingmarkevery = (float, float), but as far as I can tell, this behavior is weird.
Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp