Open stevenlis opened 5 years ago
Hello @StevenLi-DS,
thank you for your suggestions and ideas! We are always grateful for feedback and happy to accommodate users as much as possible! In fact, we are currently working to implement 3. in #51 . Your point 1. and 4. will most likely be part of the next release as well, these are great additions!
As to your first point, I am not sure if I understood you correctly, you can manipulate single Axes through defining fig, axs = plot_local_autocorrelation()
and e.g. calling axs[0].set_axis_off()
. I think adding a layout option is a great idea though, since Matplotlib currently does not support rearranging axes once a figure is drawn. Alternatively, you could directly use the moran_scatterplot(ax=axs[0,0])
lisa_cluster(ax=axs[0,1])
andgdp.plot(ax=axs[0,2])
and arrange them in a new figure in a format you would like.
What exactly would you like to have more control over in 2. with a map_kwds
?
Thanks again for the suggestions! We are happy to hear splot is making your life easier!
Hi, @slumnitz. Thanks for your reply.
I actually tried fig, axs = plot_local_autocorrelation()
before posting and it seems like I missed something and I just tried it again and indeed it's working as expected.
What exactly would you like to have more control over in 2. with a map_kwds?
The doc says the map plots use .plot()
in geopandas so I wish I could pass some kwds to control the map. For example, for the above plot, I may wanna set the edge color to grey or something. I actually eventually end up using moran_scatterplot()
and lisa_cluster()
as receiving they would give me more controls.๐
Some more feedback, I'm trying to explore autocorrelation of some linestring geometry through plot_local_autocorrelation()
and lisa_cluster()
method, but a figure without anything except a legend is returned. Everything works as expected after changing the linestring geometry to it's centroid point geometry. I guess that the linestring geometry is not supported perfectly enough?
The version of splot
is 1.1.4
Some more feedback, I'm trying to explore autocorrelation of some linestring geometry through
plot_local_autocorrelation()
andlisa_cluster()
method, but a figure without anything except a legend is returned. Everything works as expected after changing the linestring geometry to it's centroid point geometry. I guess that the linestring geometry is not supported perfectly enough?The version of
splot
is 1.1.4
I checked it again and found it is caused by the fixed parameter values of linewidth=0.1
and edgecolor='white'
of the plot()
function in lisa_cluster()
. As a result, all geometry of linestring will be invisable with a white backgroud at the same time.
Maybe it is better to do some adjust in source code with linestring geometry detected :)
As it's not convenient to set additional config I have to modify the source code (just remove the two fixed parameter values) as follow:
# original source code
# gdf.assign(cl=labels).plot(column='cl', categorical=True,
# k=2, cmap=hmap, linewidth=0.1, ax=ax,
# edgecolor='white', legend=legend,
# legend_kwds=legend_kwds, **kwargs)
gdf.assign(cl=labels).plot(column='cl', categorical=True,
k=2, cmap=hmap, ax=ax,
legend=legend,
legend_kwds=legend_kwds, **kwargs)
@qizidog This has been fixed in main
, but a fresh release has not yet been cut. See also #139, #140, and pysal/spaghetti#656.
pysal: 2.0.0
It's my first time to plot with
splot
and I think maybe I can offer some suggestions as I've seen many idea collection issues.plot_local_autocorrelation
doesn't seem supportingax
, so it might be a good idea to add aarg
to control the layout e.g., 3 by 1 or 1 by 3. (the function does return oneFig
and threeAxes
. Is there any way to manipulate them just as anyAxes
? Maybe I missed something.)adding a
map_kwds
or something to control the maps.Since the slope of the line in the Moran scatterplot represents the global Moran's I, it might be a good idea to set
xlim
equal toylim
, so that a line flatter than 45 degrees means the Moran's I is less than 0.5. Since differentxlim
andylim
will visually affect the slope of the line, it may cause problem sometimes especially when we compare two plots. (Btw,Geoda
doesn't plot outliers in the Moran scatterplot, so I'm curious of how outliers are handled insplot
)display global Moran's I and its p-value. I think most of the time, we need it as well.
The current API seems to use
Local Moran
object as input. Every time I change the variable I want to plot, then I have to calculate it again, so I think it might be easier to actually just use the columns as input.I'm actually curious if it is possible to simplify the API of
splot
to just have one function and then use args to choose which plot to display likelisa_cluster=False
.Btw, thanks for this amazing work and user-friendly package that makes plotting easy with Python.๐๐๐