Remove all slice text from Pie Chart (ios-charts/mpandroidchart) - mpandroidchart

I know the method for removing the x-values but how do I remove the y-values. I basically don't want ANY text on my Pie Chart.
The image shows the current-state with the 80.0 and 20.0 labels on top of the pie chart.

To remove the Y-Values
Use dataset.setDrawValues(false);
To remove the X-Values
Use MyPieChart.setDrawSliceText(false);

For Charts Version 3.2.1
Both X - Y values enabled
pieChartDataSet.drawValuesEnabled = true
pieChartView.drawEntryLabelsEnabled = true
To remove the Y-Values
pieChartDataSet.drawValuesEnabled = false
To remove the X-Values
pieChartView.drawEntryLabelsEnabled = false

Never mind figured it out!
pieChartView.data?.setValueTextColor(UIColor.clearColor())
That at least gets it from not seeing those labels.
Also another way is setting this to false:
drawLabelsEnabled

To remove the labels (xVals):
pieChartView.drawSliceTextEnabled = false
To remove the values (yVals):
pieChartDataSet.drawValuesEnabled = false

drawLabelsEnabled will not draw any label on your chart. It is for both xAxis and yAxis
checkout for all the basic configurations:
https://github.com/danielgindi/ios-charts/blob/master/Charts/Classes/Components/ChartAxisBase.swift

In ios-charts version 3.1.1, you can hide piechart slice labels by setting pie_chart.drawEntryLabelsEnabled = NO;

Mp Android chart,
please use this
To remove x-Values use pieChart.setDrawSliceText(false).
To remove y-Values use pieChart.getData().setDrawValues(false).

In ios-charts 2.1.3, dataset.drawValuesEnabled = NO; to hide Y-Values.

Related

Change axis labels in ggeffects plot

Is there any way to change legends/axis labels/tick marks in the plot( ) function for visualising model predictions in ggeffects? I can't find any mention of this in the function documentation, but it seems like such a bizarre thing to leave out ... ?
Thanks to user teunbrand - I hadn't realised you could add additional elements to ggeffects::plot() using as you would in ggplot( ) - adding + labs(title = "New title") etc worked!

Remove all labels from mplfinance

I am trying to remove all the labels from an mplfinance plot.
Using empty spaces on y axis still leaves the scaling label and I can't seem to reove the x labeling at all.
Appreciate if anyone knew how to do this.
Trying to achieve:
Current:
code:
import mplfinance as mpf
mpf.plot(data[i-50:i], type='candle',volume=True, mav=(7,12), style='yahoo', figratio = (3.12,3.12))
The latest version of mplfinance (0.12.5a3) has a new kwarg axisoff=True will remove all labels and axis lines.
It depends on what is the code.
You can try:
plt.set_xlabel("")
or could you please provide an example, that will be really helpful.
Thanks

Setting legend location in matplotlib (while using geopandas)

I have tried several different methods to change my plot's legend's position, but none of them have worked. I would like to set the position for example to upper left or upper right.
I have a GeoDataFrame (data_proj) which has polygons in it. I want to plot only one map with those polygons.
I created my plot like this:
p = data_proj.plot(column = "Level3", linewidth=0.03, legend = True)
I used these to set the title etc. for the legend:
leg = p.get_legend()
leg.set_title("Land cover")
leg.get_frame().set_alpha(0)
How can I change the location of the legend?
On geopandas master (i.e., a change made subsequent to the current 0.3.0 release), a legend_kwds argument was added to the plot method. One can then do the following:
ax = df.plot(column='values', categorical=True, legend=True, legend_kwds={'loc': 2})
In principle setting the legend should work as usual. The loc parameter can be used to define the location of the legend.
p = data_proj.plot(column = "Level3", linewidth=0.03)
leg = p.legend(loc="upper right")
leg.set_title("Land cover")
leg.get_frame().set_alpha(0)

tight_layout() for FigureCanvasTkAgg

I need to add 2 subplots in a canvas. Im trying to use FigureCanvasTkAgg as the plots need to be 3-D interactive. Is there any equvivalent of tight_layout feature available in canvas/FigureCanvasTkAgg ? Tried FigureCanvasTkAgg.tight_layout() and gives error..
f = Figure(figsize=(5,3), dpi=100)
a = f.add_subplot(121)
a.plot([1,2,3,4,5,6,7,8],[5,6,1,3,8,9,3,5])
a1 = f.add_subplot(122)
a1.plot([1,2,3,4,5,6,7,8],[5,6,1,3,8,9,3,5])
canvas = FigureCanvasTkAgg(f, self)
canvas.show()
canvas.tight_layout()
canvas.get_tk_widget().grid(row=20,column=6,sticky=W)
Using fig = Figure(tight_layout=True) solved the problem mentioned by #James Brown where the figure is taken to the edge in my case (Windows 10, Python 3.8.3, Matplotlib 3.2.2).
Understood with some trials. tight_layout() is associated with the Figure and not the backend.
f.tight_layout() inserted before canvas declaration solves the issue
I wanted to set my own setting because tight_layout take it to edge of the frame. I used the toolbar to get my numbers and place this before the canvas.
f.subplots_adjust(left=0.06, bottom=0.16, right=0.90, top=0.92, wspace=0.21, hspace=0.67)

Plotly colourbar legend not showing max or min value

I have a plotly chart with a colourbar legend.
I'd like this to go from 0 to 100 with the ticks set every 10.
No matter how I try, the chart always starts the ticks at 10 and ends at 90. Removing my top and bottom tick.
Any thoughts on how to make these appear? the API doesn't seem particularly complete in this area.
trace = go.Heatmap( colorscale=COLORSCALE,
colorbar = dict(
tickvals = [0,10,20,30,40,50,60,70,80,90,100],
tickmode = 'array',
)
...
)
would be one way, in Python; practically the same in JS
But as #Levent pointed out, we can't tell you what you need without code.