我想编辑单词:setosa。我尝试过实验和主题,但我无法改变。
# My code:
d <- iris
my_graph <- function(i){
d %>% filter(Species== i) %>%
ggplot(aes(x=i,y=Sepal.Length,fill=i)) + geom_boxplot() +labs(x="title", y="title") + theme (legend.position="none") -> grafico
return(grafico)
}
for( i in unique(d$Species)){
assign(paste0('gr_',i),
my_graph(i))
}
gr_setosa
我的图表:
答案 0 :(得分:1)
您想要删除x轴上的标签:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_people_list, container, false);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mContactlistView = (ListView) view.findViewById(R.id.people_list);
mContactlistView.setAdapter(adapter);
if(state != null) {
Log.d(TAG, "trying to restore listview state..");
mContactlistView.requestFocus();
mContactlistView.onRestoreInstanceState(state);
}
indexLayout = (LinearLayout) view.findViewById(R.id.side_index);
}
@Override
public void onPause() {
Log.d(TAG, "saving listview state @ onPause");
state = mContactlistView.onSaveInstanceState();
super.onPause();
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (mContactlistView.getAdapter() == null) {
adapter = new PeopleAdapter(getActivity().getApplicationContext(),
R.layout.people_list_item, contactList);
mContactlistView.setAdapter(adapter);
mContactlistView.setTextFilterEnabled(false);
mContactlistView.setFastScrollEnabled(true);
} else {
adapter.notifyDataSetChanged();
}
mContactlistView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String empId = String.valueOf(adapter.getItem(position).getEmployeeId());
String name = String.valueOf(adapter.getItem(position).getFirstName());
intent = new Intent(getActivity(),
PeopleDetailsActivity.class);
intent.putExtra("EmployeeId", empId);
intent.putExtra("name", name);
startActivity(intent);
}
});
startAsyncTask();
}