The Question : 308 people think this question is useful TL;DR -> How can one create a legend for a line graph in Matplotlib‘s PyPlot without creating any extra variables? Please consider the graphing script below: As you can see, this is a very basic use of matplotlib‘s PyPlot. This ideally generates a graph like

The Question : 307 people think this question is useful Given a plot of signal in time representation, how to draw lines marking corresponding time index? Specifically, given a signal plot with time index ranging from 0 to 2.6(s), I want to draw vertical red lines indicating corresponding time index for the list [0.22058956, 0.33088437,

The Question : 305 people think this question is useful I have made my plots inline on my Ipython Notebook with “%matplotlib inline.” Now, the plot appears. However, it is very small. Is there a way to make it appear larger using either notebook settings or plot settings? The Question Comments : The Answer 1

The Question : 321 people think this question is useful I am trying to use networkx with Python. When I run this program it get this error. Is there anything missing? I get a different error now: I get a different error now: The Question Comments : possible duplicate of Generating matplotlib graphs without a

The Question : 322 people think this question is useful I’m new to Python and Matplotlib, I would like to simply apply colormap to an image and write the resulting image, without using axes, labels, titles or anything usually automatically added by matplotlib. Here is what I did: It successfully removes the axis of the

The Question : 319 people think this question is useful I have a plot with two y-axes, using twinx(). I also give labels to the lines, and want to show them with legend(), but I only succeed to get the labels of one axis in the legend: So I only get the labels of the

The Question : 334 people think this question is useful In a matplotlib figure, how can I make the font size for the tick labels using ax1.set_xticklabels() smaller? Further, how can one rotate it from horizontal to vertical? The Question Comments : Thanks for asking this question, I’m trying to solve this problem right now.

The Question : 343 people think this question is useful I have a semilogx plot and I would like to remove the xticks. I tried: The grid disappears (ok), but small ticks (at the place of the main ticks) remain. How to remove them? The Question Comments : Some of the solutions didn’t work for

The Question : 349 people think this question is useful I can’t figure out how to rotate the text on the X Axis. Its a time stamp, so as the number of samples increase, they get closer and closer until they overlap. I’d like to rotate the text 90 degrees so as the samples get

The Question : 351 people think this question is useful I am plotting a dataset using matplotlib where I have an xlabel that is quite “tall” (it’s a formula rendered in TeX that contains a fraction and is therefore has the height equivalent of a couple of lines of text). In any case, the bottom

The Question : 358 people think this question is useful Simple question here: I’m trying to get the size of my legend using matplotlib.pyplot to be smaller (i.e., the text to be smaller). The code I’m using goes something like this: The Question Comments : The Answer 1 593 people think this answer is useful

The Question : 357 people think this question is useful I came across this example in the Matplotlib website. I was wondering if it was possible to increase the figure size. I tried with but it does nothing. The Question Comments : The Answer 1 665 people think this answer is useful If you already