I’m trying to make a point and figure chart. I can get it to work printing out on the terminal but I want to graph it with matplotlib. What would be the best way of doing something like this? I was thinking scatter, but when I do this the columns are spread out too far. I would like to get something much like the chart from the link I provided where the columns are as close to one another as possible. Is there a parameter I can overwrite to force this? First time using matplotlib so please excuse me if this is trivial. Thanks.
Share
You can adjust the size of the symbols used in a scatter plot by choosing the
sparameter. You also will likely need to adjust the size of your figure (with figsize) or the dimensions of your axes (with add_axes). This is because the symbols for scatter are square, in display units, and the x and y axis are not automatically adjusted so that width-of-one-change = height-of-one-box.In other words, the example you provided is a rectangular plot with the height > width, and the height and width are chosen to make the width-of-one-change == height-of-one-box.
Here’s an example of apply these techniques:
The method developed for each scatter plot is very hackish, but the key point is that I needed to play with the scatter
sparameter and the figure size to get something of the desired effect.The resulting plot is:
Ideally, one would make a custom method modeled after the scatter method. It would create a custom
Collectioninstance that would include the x’s, o’s and month labels. It would also a) automatically adjust the axes/figure aspect or b) make asymmetric symbols. This is obviously an advanced option, intended for someone wishing to contribute, as a developer, to the Matplotlib project.