Skip to content
Advertisement

Tag: matplotlib

Cannot connect to localhost:63342 when using matplotlib in PyCharm’s Python scientific plotting

My PyCharm’s scientific plotting mode doesn’t work on localhost (not remote). It reports: My matplotlib with the show plots in tool window in Tools -> Python Scientific unchecked (plot in original window instead of in SciView) worked normally. Changing a few options such as debugging server’s port and python’s interpreter (anaconda3 (Python 3.7) and pure version of Python 3.8.3) does

Plotting different shape 2D arrays in matplotlib

I couldn’t find any answer to this specific case. Say I want to create a scatter plot from the following data: Where all the values of y[0] are the correseponding values of X[0] (86) and so on. I know I can just use numpy repeat function but I thought maybe there’s any other more feasilbe option? I’ve tried to reshape

How to specify the color for a partial histogram patch

I would like to produce the following graph Note that one bar is partially blue and partially teal. This is what I’m trying to reproduce Rectangle(xy=(0.876747, 0), width=0.408487, height=0.206371, angle=0) is the Rectangle that needs to be partially colored. Rectangle(xy=(1.28523, 0), width=0.408487, height=0.150066, angle=0) is the patch immediately after, which is colored Teal Plot generated by my code Note the

Convert x-axis from days to month in matplotlib

i have x-axis which is in terms of days (366 days Feb was taken as 29 days) but instead I want to convert it in terms of months (Jan – Dec). What should i do… Answer I think the quickest change might be to just set new ticks and tick labels at the starts of months; I found the conversion

Multiple (matplotlib) plots generated in loop not visibly updating

So I’m trying to generate two separate figures in a loop, such that on each iteration the plots are refreshed with the most recent output of a function: However what’s happening is that only figB is visibly updated, while figA is not. Once the loop completes, then both plots display the final output. Why are both figures not visibly updating

the graphs of the two projectiles does not work properly when complementary angles(eg 30 and 60) are passes to xy_plot1 and xyplot2 function

Answer Be careful! Your theta argument for the xyplot() function is in degrees, but inside your function, the math.sin() function takes the argument for the angle in units of radians. The easiest fix is to provide your theta argument in units of radians instead of degrees. You also don’t need both functions if they do the exact same thing, as

Advertisement