На самом деле существует более простой способ. Я только что нашел:
import matplotlib.pyplot as plt
# We prepare the plot
fig = plt.figure(1)
# We define a fake subplot that is in fact only the plot.
plot = fig.add_subplot(111)
# We change the fontsize of minor ticks label
plot.tick_params(axis='both', which='major', labelsize=10)
plot.tick_params(axis='both', which='minor', labelsize=8)
Это только ответы на размер label
части вашего вопроса.
Вот простой пример, поскольку вы не поделились достаточным количеством кода, вы можете сравнить свой код с этим.
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Test',
theme: ThemeData(
brightness: Brightness.dark,
primaryColor: Color(0xFF048ec8),
indicatorColor: Colors.red,
cursorColor: Colors.red,
),
home: MainScreenWithTab(),
);
}
}
class MainScreenWithTab extends StatefulWidget {
@override
State<StatefulWidget> createState() => MainScreenWithTabState();
}
class MainScreenWithTabState extends State<MainScreenWithTab> {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 2,
child: Scaffold(
appBar: AppBar(
title: Text('Screen'),
),
body: Column(
children: <Widget>[
TabBar(
tabs: <Widget>[
Tab(
text: 'Left',
),
Tab(
text: 'Right',
)
],
),
Expanded(
child: TabBarView(children: [
RaisedButton(
child: Text('Tap for new screen'),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => Screen()));
},
),
FlatButton(
child: Text('Push View 2'),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => Screen()));
},
),
]),
),
],
),
),
);
}
}
class Screen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Screen'),
),
body: Container(
width: double.infinity,
height: double.infinity,
color: Colors.yellow,
child: Center(
child: Text('New Screen'),
),
),
);
}
}