Skip to content
Advertisement

Tag: matplotlib

Why does matplotlib.pyplot.savefig() mess up image outputs for very large pandas.plotting.scatter_matrix()?

I was trying to compute the pandas.plotting.scatter_matrix() values for very large pandas.DataFrame() (relatively speaking for this specific operation, most libraries either run OOM most of the time or implement a row count check of 50000, see vaex-scatter). The ‘Time series’ DataFrame shape I have is (10000000, 41). Every value is either a float or an integer. Q1: So the first

How to efficiently draw a plot of a torch.nn model?

I’m exploring neural networks, and I want to model some pictures with neural network. Picture is a function that maps pixel coordinates to color, so I make my network also with 2 input variables (x, y) and 1 (shade) to 3 (R, G, B) output coordinates. For example, like this: Now, I plot it like this: But it looks ugly

Making legend for subplot with scatter points

I’m trying to make a legend for my subplot using Python. Here’s part of my code: This method works when I was not using subplot, but now it returns me the following error message: I’m not pretty sure how I can fix this issue. Thanks for the help! Answer The code has an object which should not be present there

Set individual wedge hatching for pandas pie chart

I am trying to make pie charts where some of the wedges have hatching and some of them don’t, based on their content. The data consists of questions and yes/no/in progress answers, as shown below in the MWE. However, instead of greenyellow and gold I am trying to make the wedges green with yellow hatching, and yellow with red hatching,

Total figure width with external legend in matplotlib

I’m using plt.legend(bbox_to_anchor = (1,1)) to put the legend outside my figure. The journal to which I’m submitting requires specific sizes for the figures. When I use this method, it increases the total width of my figure beyond the required size. I want to have the figure sized exactly to specification. Is there a way to calculate the total width

Reflecting 4d symmetric data

I’ve found out that there is no example of how to reflect symmetric 4d data, which can be very useful when 3d simulations wants to be performed using a symmetric plane to reduce calculations(e.g. ANSYS, COMSOL, etc). This example shows a data file structure corresponding to a COMSOL simulation, which has the structure: X, Y, Z, Amplitude The model had

How to fix this import matplotlib problem in M1 Mac?

I bought Mac M1, and now setting up my python environment. I installed Rosetta 2, and set my Terminal as Rosetta 2 I installed pyenv with brew installed Sqlite3 with brew installed python 3.9.4 with pyenv (set as global) installed visual studio code with brew installed pandas with pip in Terminal(arm64) (problem solved, thank you hd1) Now I am trying

Advertisement