ESAC-stats-2014 icon indicating copy to clipboard operation
ESAC-stats-2014 copied to clipboard

matplotlib markers not showing up...

Open drjmcauliffe opened this issue 11 years ago • 7 comments

In some over zealous pre-workshop preparation I cloned the repo and attempted a quick run through of some of the code... when I use plt.plot(x, y, 'o') or similar the 'o' doesn't appear in the resulting plot... nor do other 'x', '.', ',' etc. If I leave it out altogether I get a line plot. I'm in a venv with the following installed:

stroML==0.2 astropy==0.4.2 emcee==2.1.0 ipython==2.3.0 matplotlib==1.4.2 numpy==1.9.0 pandas==0.15.0 scikit-learn==0.15.2 scipy==0.14.0 seaborn==0.4.0

Python 2.7.8... any ideas? Looking forward to a busy week of learning.

J.

P.S. the semicolon at the end of the plt.plot(); ... brilliant! Been looking for that for months...

drjmcauliffe avatar Oct 25 '14 23:10 drjmcauliffe

No idea. That's really strange.

jakevdp avatar Oct 26 '14 13:10 jakevdp

What if you set the color, like plt.plot(x, y, 'ob')?

jakevdp avatar Oct 26 '14 13:10 jakevdp

With 1.4.2 and 1.4.1 I couldn't get the markers to appear - even by adding the colour letter... but with 1.4.0 everything works as in your original notebook example. Dunno what's changed in the latest releases but I'll stick with 1.4.0 for the workshop... what version did you use for the the notebook preparation? Might it be 1.4.0 also?

drjmcauliffe avatar Oct 26 '14 15:10 drjmcauliffe

Yep, I'm using 1.4.0

jakevdp avatar Oct 26 '14 21:10 jakevdp

I'm having this same problem with matplotlib 1.4.2, but only if I use 'png' inline backend. If I switch to svg then the markers appear:

%config InlineBackend.figure_format = 'svg'

patricksurry avatar Jan 07 '16 20:01 patricksurry

Discovered a lengthy thread here: https://github.com/mwaskom/seaborn/issues/344

sounds like a matplotlib issue they're fixing.

patricksurry avatar Jan 07 '16 20:01 patricksurry

I encountered the same problem.

In my case, it seems like the problem was caused by seaborn that I imported after matplotlib.

without importing seaborn, the markers show up just fine.

xiyuyi avatar Jun 13 '18 01:06 xiyuyi