Wild Feather
Wild Feather

Reputation: 229

How to draw bigger points on a Python plot

I'm trying to plot a set of points with Python, using the following code:

#!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import pylab as pl
y = [0.86,0.64,0.96,1.06,1.00,1.17,1.08,1.47,1.93,1.05,2.00,2.22,1.72,1.83]
x = [2.165,2.163,0.028,2.4,3.6,2.12,2.160,3.0,2.2,2.514,2.6,3.6,2.171,1.37]
pl.plot(x, y, 'rp')
pl.title('My points')
pl.ylabel('Second variable')
pl.xlabel('First variable')
pl.ylim(0.0, 2.5)
pl.xlim(0.0, 4.0)
pl.show()

But the output is a graph where the red points are too little, and I'd like to increase their area. Is there any easy way to do this? I'm a beginner in Python, and haven't been able to find anything that could help.

Upvotes: 0

Views: 15166

Answers (1)

Cory Kramer
Cory Kramer

Reputation: 117856

One of the arguments of plot is markersize, so you can say for example

pl.plot(x, y, 'rp', markersize=14)

Upvotes: 7

Related Questions