I explored Groupby and Aggregate here
I explored Groupby and Aggregate here
The tools we need are matplotlib and pandas
Step 1, is to create a pandas dataframe from an AutoCAD table, the structure is a dictionary {header : [data array]}. We’ll need to create a map (dictionary) of our headers so we can access them later. Next, iterate the data cells and put them in the appropriate bucket
Step 2, setup our plot configuration, setup our colors. Note, we need to make sure the column we want to plot is the correct data type, if you’ll notice the astype cast. Run the plot
Optional step 3, insert the result as a raster image
here's the code
There’s a couple of options when showing a plot from matplotlib,
1, is to use wxPython. This is nice because you can embed the plot with other controls, you also have the option of making the window modal, or put the plot in a palette. There’s samples here and here
2, Is you just want to show the plot. Maybe you want to save the plot as a PNG and paste in into AutoCAD as a Raster image.
In this case, all you really need to do is make sure you call show with block=False
import traceback from pyrx_imp import Rx from pyrx_imp import Ge from pyrx_imp import Gi from pyrx_imp import Db from pyrx_imp...